org.tizen.dynamicanalyzer.widgets_1.0.0.201310312018

16:50:01.773 INFO  jd.cli.Main - Decompiling org.tizen.dynamicanalyzer.widgets_1.0.0.201310312018.jar
package org.tizen.dynamicanalyzer.widgets;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class Activator
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.tizen.dynamicanalyzer.widgets";
  private static Activator plugin;
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    plugin = this;
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    plugin = null;
    super.stop(context);
  }
  
  public static Activator getDefault()
  {
    return plugin;
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.Activator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets;

public class DAWidgetConstants
{
  public static final String EMPTY_STRING = "";
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.DAWidgetConstants
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.animation;

import java.util.List;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;

class DAAnimationIcon$1
  implements PaintListener
{
  DAAnimationIcon$1(DAAnimationIcon paramDAAnimationIcon) {}
  
  public void paintControl(PaintEvent e)
  {
    Canvas canvas = (Canvas)widget;
    canvas.setBackground(canvas.getParent().getBackground());
    Rectangle rect = canvas.getClientArea();
    if (this$0.index >= DAAnimationIcon.access$0(this$0).size()) {
      this$0.index = 0;
    }
    gc.drawImage((Image)DAAnimationIcon.access$0(this$0).get(this$0.index++), x, y);
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.animation.DAAnimationIcon.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.animation;

class DAAnimationIcon$2$1
  implements Runnable
{
  DAAnimationIcon$2$1(DAAnimationIcon.2 param2) {}
  
  public void run()
  {
    if ((this != null) && (!DAAnimationIcon.2.access$0(this$1).isDisposed()))
    {
      DAAnimationIcon.2.access$0(this$1).redraw();
      DAAnimationIcon.2.access$0(this$1).update();
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.animation.DAAnimationIcon.2.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.animation;

import java.util.TimerTask;
import org.eclipse.swt.widgets.Display;

class DAAnimationIcon$2
  extends TimerTask
{
  DAAnimationIcon$2(DAAnimationIcon paramDAAnimationIcon) {}
  
  public void run()
  {
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        if ((this != null) && (!this$0.isDisposed()))
        {
          this$0.redraw();
          this$0.update();
        }
      }
    });
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.animation.DAAnimationIcon.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.animation;

import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;

public class DAAnimationIcon
  extends Canvas
{
  private List<Image> imageList = null;
  Timer timer = null;
  long interval = 100L;
  int index = 0;
  
  public DAAnimationIcon(Composite parent, int style)
  {
    super(parent, style | 0x40000000);
    addPaintListener(paintListener);
  }
  
  public DAAnimationIcon(Composite parent, int style, List<Image> images)
  {
    this(parent, style);
    
    imageList.addAll(images);
  }
  
  public void setInterval(long interval)
  {
    this.interval = interval;
  }
  
  public void start()
  {
    startTimer();
  }
  
  private PaintListener paintListener = new PaintListener()
  {
    public void paintControl(PaintEvent e)
    {
      Canvas canvas = (Canvas)widget;
      canvas.setBackground(canvas.getParent().getBackground());
      Rectangle rect = canvas.getClientArea();
      if (index >= imageList.size()) {
        index = 0;
      }
      gc.drawImage((Image)imageList.get(index++), x, y);
    }
  };
  
  private void startTimer()
  {
    if (timer != null) {
      stopTimer();
    }
    timer = new Timer();
    
    timer.schedule(new TimerTask()
    {
      public void run()
      {
        Display.getDefault().syncExec(new Runnable()
        {
          public void run()
          {
            if ((this != null) && (!isDisposed()))
            {
              redraw();
              update();
            }
          }
        });
      }
    }, 10L, interval);
  }
  
  public void stopTimer()
  {
    if (timer != null)
    {
      timer.cancel();
      timer = null;
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.animation.DAAnimationIcon
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button;

import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

class DACustomButton$1
  implements Listener
{
  DACustomButton$1(DACustomButton paramDACustomButton) {}
  
  public void handleEvent(Event event)
  {
    if (this$0.state == 3) {
      return;
    }
    if (type == 6) {
      this$0.changeButtonState(2);
    }
    if (type == 7) {
      this$0.changeButtonState(0);
    }
    if (type == 3) {
      this$0.changeButtonState(1);
    }
    if (type == 4) {
      this$0.changeButtonState(2);
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.DACustomButton.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button;

import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.widgets.Canvas;

class DACustomButton$2
  implements PaintListener
{
  DACustomButton$2(DACustomButton paramDACustomButton) {}
  
  public void paintControl(PaintEvent e)
  {
    this$0.buttonRenderer.draw(gc, (Canvas)widget, this$0.state, this$0.attr);
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.DACustomButton.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button;

import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

class DACustomButton$3
  implements Listener
{
  DACustomButton$3(DACustomButton paramDACustomButton) {}
  
  public void handleEvent(Event event)
  {
    DACustomButton button = (DACustomButton)widget;
    if (button != null)
    {
      Rectangle rectangle = button.getBounds();
      int x = x;
      int y = y;
      if ((x < 0) || (x > width) || (y < 0) || 
        (y > height)) {
        return;
      }
      button.setFocus();
    }
    else {}
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.DACustomButton.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button;

import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;

public class DACustomButton
  extends Canvas
{
  public static final int STATE_NORMAL = 0;
  public static final int STATE_PUSH = 1;
  public static final int STATE_HOVER = 2;
  public static final int STATE_DISABLE = 3;
  public static final int TYPE_IMAGE = 0;
  public static final int TYPE_COLOR = 1;
  public static final int TYPE_GRADATION = 2;
  protected int state = 0;
  protected DACustomButtonAttribute attr;
  protected IDACustomButtonRenderer buttonRenderer = null;
  
  public DACustomButton(Composite parent, int style)
  {
    super(parent, style);
    setForeground(ColorResources.WHITE);
    addPaintListener(buttonPaintListener);
    addListeners();
    buttonRenderer = new DACustomButtonRenderer();
    attr = new DACustomButtonAttribute();
    setDefaultColors();
    addListener(4, new Listener()
    {
      public void handleEvent(Event event)
      {
        DACustomButton button = (DACustomButton)widget;
        if (button != null)
        {
          Rectangle rectangle = button.getBounds();
          int x = x;
          int y = y;
          if ((x < 0) || (x > width) || (y < 0) || 
            (y > height)) {
            return;
          }
          button.setFocus();
        }
        else {}
      }
    });
  }
  
  public DACustomButton(Composite parent, String titleText)
  {
    this(parent, 0);
    attr.setText(titleText);
  }
  
  public DACustomButton(Composite parent, Image normal, Image mouseDown, Image hover, Image disable)
  {
    this(parent, 1073741824);
    setImages(normal, mouseDown, hover, disable);
    attr.setDrawType(0);
  }
  
  public DACustomButton(Composite parent, Color normalStart, Color normalEnd, Color pushStart, Color pushEnd, Color hoverStart, Color hoverEnd, Color disableStart, Color disableEnd)
  {
    this(parent, 0);
    attr.setColor(0, normalStart);
    attr.setColor(1, normalEnd);
    attr.setColor(2, pushStart);
    attr.setColor(3, pushEnd);
    attr.setColor(4, hoverStart);
    attr.setColor(5, hoverEnd);
    attr.setColor(6, disableStart);
    attr.setColor(7, disableEnd);
    attr.setDrawType(2);
  }
  
  protected void addListeners()
  {
    addListener(6, buttonMouseListener);
    addListener(7, buttonMouseListener);
    addListener(3, buttonMouseListener);
    addListener(4, buttonMouseListener);
  }
  
  protected void changeButtonState(int state)
  {
    this.state = state;
    redraw();
  }
  
  protected Listener buttonMouseListener = new Listener()
  {
    public void handleEvent(Event event)
    {
      if (state == 3) {
        return;
      }
      if (type == 6) {
        changeButtonState(2);
      }
      if (type == 7) {
        changeButtonState(0);
      }
      if (type == 3) {
        changeButtonState(1);
      }
      if (type == 4) {
        changeButtonState(2);
      }
    }
  };
  
  private void setDefaultColors()
  {
    attr.setColor(3, 
      ColorResources.BUTTON_STATE_DISABLE);
    attr.setColor(1, ColorResources.BUTTON_STATE_PUSH);
    attr.setColor(2, ColorResources.BUTTON_STATE_HOVER);
    attr.setColor(0, ColorResources.BUTTON_STATE_NORMAL);
  }
  
  protected PaintListener buttonPaintListener = new PaintListener()
  {
    public void paintControl(PaintEvent e)
    {
      buttonRenderer.draw(gc, (Canvas)widget, state, attr);
    }
  };
  
  public void setTitle(String newTitle)
  {
    attr.setText(newTitle);
  }
  
  public void setText(String newTitle)
  {
    attr.setText(newTitle);
  }
  
  public void setButtonImage(Image img)
  {
    attr.setButtonImage(img);
  }
  
  public void setRenderer(IDACustomButtonRenderer newRenderer)
  {
    buttonRenderer = newRenderer;
  }
  
  public void setButtonEnabled(boolean enabled)
  {
    if (enabled) {
      changeButtonState(0);
    } else {
      changeButtonState(3);
    }
  }
  
  public boolean isButtonEnabled()
  {
    if (state == 3) {
      return false;
    }
    return true;
  }
  
  public void setImage(int state, Image image)
  {
    attr.setImage(state, image);
  }
  
  public Image getImage(int state)
  {
    return attr.getImage(state);
  }
  
  public void setColor(int state, Color color)
  {
    attr.setColor(state, color);
  }
  
  public void setFont(Font font)
  {
    attr.setFont(font);
  }
  
  public void setFontPoint(Point point)
  {
    attr.setFontPoint(point);
  }
  
  public void setColors(Color normal, Color push, Color hover, Color disable)
  {
    attr.setColor(0, normal);
    attr.setColor(1, push);
    attr.setColor(2, hover);
    attr.setColor(3, disable);
    attr.setDrawType(1);
  }
  
  public void setImages(Image normal, Image push, Image hover, Image disable)
  {
    attr.setImage(0, normal);
    attr.setImage(1, push);
    attr.setImage(2, hover);
    attr.setImage(3, disable);
    attr.setDrawType(0);
  }
  
  public void setOutlineColors(Color normal, Color push, Color hover, Color disable)
  {
    attr.setOutlineColor(0, normal);
    attr.setOutlineColor(1, push);
    attr.setOutlineColor(2, hover);
    attr.setOutlineColor(3, disable);
  }
  
  public void setOutlineInColors(Color normal, Color push, Color hover, Color disable)
  {
    attr.setOutlineInColor(0, normal);
    attr.setOutlineInColor(1, push);
    attr.setOutlineInColor(2, hover);
    attr.setOutlineInColor(3, disable);
  }
  
  public void setGradationColor(int state, Color start, Color end)
  {
    attr.setColor(state * 2, start);
    attr.setColor(state * 2 + 1, end);
  }
  
  public void setGradation(Color normalStart, Color normalEnd, Color pushStart, Color pushEnd, Color hoverStart, Color hoverEnd, Color disableStart, Color disableEnd)
  {
    attr.setColor(0, normalStart);
    attr.setColor(1, normalEnd);
    attr.setColor(2, pushStart);
    attr.setColor(3, pushEnd);
    attr.setColor(4, hoverStart);
    attr.setColor(5, hoverEnd);
    attr.setColor(6, disableStart);
    attr.setColor(7, disableEnd);
    attr.setDrawType(2);
  }
  
  public void addClickListener(DACustomButtonClickEventListener listener)
  {
    addListener(4, listener);
  }
  
  public int getState()
  {
    return state;
  }
  
  public void setFontColors(Color normal, Color push, Color hover, Color disable)
  {
    attr.setFontColor(0, normal);
    attr.setFontColor(1, push);
    attr.setFontColor(2, hover);
    attr.setFontColor(3, disable);
  }
  
  public void setFontColor(int state, Color color)
  {
    attr.setFontColor(state, color);
  }
  
  public void setIcon(Image icon)
  {
    attr.setIcon(icon);
  }
  
  public void setAlign(int align)
  {
    attr.setAlign(align);
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.DACustomButton
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;

public class DACustomButtonAttribute
{
  private static final int MAX_SIZE = 12;
  private String text;
  private Image buttonImage = null;
  private Font font;
  private Point fontPoint;
  private int drawType = 1;
  private int align = 16777216;
  private Image iconImage = null;
  private List<Image> images = new ArrayList();
  private List<Color> colors = new ArrayList();
  private List<Color> fontColors = new ArrayList();
  private List<Color> outlineColors = new ArrayList();
  private List<Color> outlineInColors = new ArrayList();
  
  public DACustomButtonAttribute()
  {
    for (int i = 0; i < 12; i++)
    {
      images.add(null);
      colors.add(null);
      fontColors.add(null);
      outlineColors.add(null);
      outlineInColors.add(null);
    }
  }
  
  public String getText()
  {
    return text;
  }
  
  public void setText(String text)
  {
    this.text = text;
  }
  
  public Image getButtonImage()
  {
    return buttonImage;
  }
  
  public void setButtonImage(Image img)
  {
    buttonImage = img;
  }
  
  public Font getFont()
  {
    return font;
  }
  
  public void setFont(Font font)
  {
    this.font = font;
  }
  
  public Point getFontPoint()
  {
    return fontPoint;
  }
  
  public void setFontPoint(Point fontPoint)
  {
    this.fontPoint = fontPoint;
  }
  
  public int getDrawType()
  {
    return drawType;
  }
  
  public void setDrawType(int type)
  {
    drawType = type;
  }
  
  public Image getImage(int state)
  {
    if (!images.isEmpty()) {
      return (Image)images.get(state);
    }
    return null;
  }
  
  public void setImage(int state, Image img)
  {
    images.set(state, img);
  }
  
  public Color getColor(int state)
  {
    if (!colors.isEmpty()) {
      return (Color)colors.get(state);
    }
    return null;
  }
  
  public void setColor(int state, Color color)
  {
    colors.set(state, color);
  }
  
  public void setFontColor(int state, Color color)
  {
    fontColors.set(state, color);
  }
  
  public Color getFontColor(int state)
  {
    return (Color)fontColors.get(state);
  }
  
  public void setOutlineColor(int state, Color color)
  {
    outlineColors.set(state, color);
  }
  
  public Color getOutlineColor(int state)
  {
    return (Color)outlineColors.get(state);
  }
  
  public void setOutlineInColor(int state, Color color)
  {
    outlineInColors.set(state, color);
  }
  
  public Color getOutlineInColor(int state)
  {
    return (Color)outlineInColors.get(state);
  }
  
  public void setIcon(Image icon)
  {
    iconImage = icon;
  }
  
  public Image getIcon()
  {
    return iconImage;
  }
  
  public void setAlign(int align)
  {
    this.align = align;
  }
  
  public int getAlign()
  {
    return align;
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.DACustomButtonAttribute
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button;

import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

public abstract class DACustomButtonClickEventListener
  implements Listener
{
  public void handleEvent(Event event)
  {
    DACustomButton button = (DACustomButton)widget;
    if ((button != null) && (button.getState() != 3))
    {
      Rectangle rectangle = button.getBounds();
      int x = x;
      int y = y;
      if ((x >= 0) && (x <= width) && (y >= 0) && (y <= height)) {}
    }
    else
    {
      return;
    }
    String tooltip = button.getToolTipText();
    button.setToolTipText(null);
    handleClickEvent(button);
    if (!button.isDisposed()) {
      button.setToolTipText(tooltip);
    }
  }
  
  public abstract void handleClickEvent(DACustomButton paramDACustomButton);
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button;

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Display;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;

public class DACustomButtonRenderer
  implements IDACustomButtonRenderer
{
  public void draw(GC gc, Canvas canvas, int state, DACustomButtonAttribute attr)
  {
    Rectangle rect = canvas.getClientArea();
    if (attr.getDrawType() == 0) {
      drawImageButton(gc, rect, state, attr);
    } else if ((attr.getDrawType() == 1) || 
      (attr.getDrawType() == 2)) {
      drawButton(gc, rect, state, attr);
    }
    drawButtonImage(gc, rect, attr);
    drawIcon(gc, rect, attr);
  }
  
  public int computeFontSize(Rectangle rect)
  {
    if (height > 20) {
      return 10;
    }
    return 8;
  }
  
  protected void drawImageButton(GC gc, Rectangle rect, int state, DACustomButtonAttribute attr)
  {
    Image image = attr.getImage(state);
    if (image == null) {
      return;
    }
    gc.drawImage(image, x, y);
    drawButtonText(gc, rect, attr, state);
  }
  
  protected void drawIcon(GC gc, Rectangle parentRect, DACustomButtonAttribute attr)
  {
    Image icon = attr.getIcon();
    if (icon == null) {
      return;
    }
    gc.drawImage(icon, x + 2, 
      height / 2 - getBoundsheight / 2);
  }
  
  protected void drawButton(GC gc, Rectangle rect, int state, DACustomButtonAttribute attr)
  {
    if (attr.getDrawType() == 1)
    {
      gc.setBackground(attr.getColor(state));
      gc.fillRectangle(rect);
    }
    else
    {
      int index = state * 2;
      gc.setForeground(attr.getColor(index));
      gc.setBackground(attr.getColor(index + 1));
      gc.fillGradientRectangle(x, y, width, height, 
        true);
    }
    Rectangle r = new Rectangle(0, 0, width - 1, height - 1);
    if (attr.getButtonImage() == null) {
      drawButtonText(gc, r, attr, state);
    }
    Color c = gc.getForeground();
    if (attr.getOutlineColor(state) != null) {
      gc.setForeground(attr.getOutlineColor(state));
    } else {
      gc.setForeground(ColorResources.BLACK);
    }
    gc.drawRectangle(r);
    Rectangle ir = new Rectangle(x + 1, y + 1, width - 2, 
      height - 2);
    if (attr.getOutlineInColor(state) != null)
    {
      gc.setForeground(attr.getOutlineInColor(state));
    }
    else
    {
      gc.setForeground(c);
      return;
    }
    gc.drawRectangle(ir);
    gc.setForeground(c);
  }
  
  protected void drawButtonImage(GC gc, Rectangle rect, DACustomButtonAttribute attr)
  {
    if ((attr != null) && (attr.getButtonImage() != null))
    {
      Image img = attr.getButtonImage();
      Rectangle imgRect = img.getBounds();
      int width = width - width;
      int height = height - height;
      int x = 0;int y = 0;
      if (width > 0) {
        x = width / 2;
      }
      if (height > 0) {
        y = height / 2;
      }
      gc.drawImage(img, x, y);
    }
  }
  
  protected void drawButtonText(GC gc, Rectangle rect, DACustomButtonAttribute attr, int state)
  {
    String text = null;
    Font font = null;
    Point p = null;
    
    Rectangle textRect = new Rectangle(x, y, width, 
      height);
    if (attr.getIcon() != null)
    {
      Rectangle iconRect = attr.getIcon().getBounds();
      x += width;
      width -= width;
    }
    if ((text = attr.getText()) != null)
    {
      if ((font = attr.getFont()) == null)
      {
        font = new Font(Display.getCurrent(), "Arial", 
          computeFontSize(textRect), 0);
        attr.setFont(font);
      }
      gc.setFont(font);
      
      int x = 0;int y = 0;
      int offset = 0;
      if ((p = attr.getFontPoint()) == null)
      {
        p = gc.textExtent(text, 8);
        if (attr.getAlign() == 16777216)
        {
          x = (width - x) / 2 + x;
          x = x < 0 ? 0 : x;
          offset = -2;
        }
        else
        {
          x = x;
          offset = 2;
        }
        y = (height - y) / 2;
      }
      else
      {
        x = x;
        y = y;
      }
      if (attr.getFontColor(state) != null) {
        gc.setForeground(attr.getFontColor(state));
      } else {
        gc.setForeground(ColorResources.BLACK);
      }
      if (state == 1)
      {
        x++;
        y++;
      }
      gc.drawString(text, x + offset, y, true);
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button;

import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.widgets.Canvas;

public abstract interface IDACustomButtonRenderer
{
  public abstract void draw(GC paramGC, Canvas paramCanvas, int paramInt, DACustomButtonAttribute paramDACustomButtonAttribute);
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.IDACustomButtonRenderer
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button.checkbox;

import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;

class DACheckBox$1
  implements PaintListener
{
  DACheckBox$1(DACheckBox paramDACheckBox) {}
  
  public void paintControl(PaintEvent e)
  {
    DACheckBox me = (DACheckBox)widget;
    Rectangle rect = me.getClientArea();
    Image img = null;
    if (DACheckBox.access$0(this$0) == 0) {
      img = ImageResources.CHECKBOX_SELECTED;
    } else if (DACheckBox.access$0(this$0) == 2) {
      img = ImageResources.CHECKBOX_UNSELECTED_HOVER;
    } else if (DACheckBox.access$0(this$0) == 1) {
      img = ImageResources.CHECKBOX_UNSELECTED;
    } else if (DACheckBox.access$0(this$0) == 4) {
      img = ImageResources.CHECKBOX_UNSELECTED_DISABLE;
    } else if (DACheckBox.access$0(this$0) == 3) {
      img = ImageResources.CHECKBOX_SELECTED_DISABLE;
    } else {
      return;
    }
    Rectangle imgRect = img.getBounds();
    int x = 0;
    int y = (height - height) / 2;
    if (this$0.getBackground() != null) {
      gc.setBackground(this$0.getBackground());
    }
    gc.fillRectangle(rect);
    gc.drawImage(img, x, y);
    if ((DACheckBox.access$0(this$0) == 3) || 
      (DACheckBox.access$0(this$0) == 4)) {
      gc.setForeground(ColorResources.CHECKBOX_DISABLED_FONT_COLOR);
    } else if (this$0.getForeground() != null) {
      gc.setForeground(this$0.getForeground());
    } else {
      gc.setForeground(ColorResources.BLACK);
    }
    int fontHeight = gc.getFontMetrics().getHeight();
    x = width + 4;
    y = (height - fontHeight) / 2;
    gc.drawText(DACheckBox.access$1(this$0), x, y);
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckBox.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button.checkbox;

import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

class DACheckBox$2
  implements Listener
{
  DACheckBox$2(DACheckBox paramDACheckBox) {}
  
  public void handleEvent(Event event)
  {
    if ((DACheckBox.access$0(this$0) == 3) || 
      (DACheckBox.access$0(this$0) == 4)) {
      return;
    }
    if ((type == 6) && 
      (DACheckBox.access$0(this$0) != 0)) {
      DACheckBox.access$2(this$0, 2);
    }
    if ((type == 7) && 
      (DACheckBox.access$0(this$0) != 0)) {
      DACheckBox.access$2(this$0, 1);
    }
    if ((type == 32) && 
      (DACheckBox.access$0(this$0) != 0)) {
      DACheckBox.access$2(this$0, 2);
    }
    if (type == 4) {
      DACheckBox.access$2(this$0, 0);
    }
    this$0.redraw();
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckBox.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button.checkbox;

import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;

public class DACheckBox
  extends Canvas
{
  public static final int CHECKBOX_SELECTED = 0;
  public static final int CHECKBOX_UNSELECTED = 1;
  public static final int CHECKBOX_UNSELECTED_HOVER = 2;
  public static final int CHECKBOX_SELECTED_DISABLE = 3;
  public static final int CHECKBOX_UNSELECTED_DISABLE = 4;
  private int state = 1;
  private String text = null;
  
  public DACheckBox(Composite parent, int style)
  {
    super(parent, style);
    addPaintListener(checkboxPaintListener);
    addListener(6, mouseListener);
    addListener(7, mouseListener);
    addListener(4, mouseListener);
    text = "";
  }
  
  public void setText(String text)
  {
    this.text = text;
  }
  
  public String getText()
  {
    return text;
  }
  
  public void setChecked(boolean checked)
  {
    if (checked) {
      state = 0;
    } else {
      state = 1;
    }
  }
  
  public void setCheckboxEnabled(boolean enabled)
  {
    if ((state == 0) || (state == 3))
    {
      if (enabled) {
        state = 0;
      } else {
        state = 3;
      }
    }
    else if (enabled) {
      state = 1;
    } else {
      state = 4;
    }
    redraw();
  }
  
  public void setEnabled(boolean enabled)
  {
    setCheckboxEnabled(enabled);
  }
  
  public boolean isCheckboxEnabled()
  {
    if ((state == 3) || 
      (state == 4)) {
      return false;
    }
    return true;
  }
  
  private PaintListener checkboxPaintListener = new PaintListener()
  {
    public void paintControl(PaintEvent e)
    {
      DACheckBox me = (DACheckBox)widget;
      Rectangle rect = me.getClientArea();
      Image img = null;
      if (state == 0) {
        img = ImageResources.CHECKBOX_SELECTED;
      } else if (state == 2) {
        img = ImageResources.CHECKBOX_UNSELECTED_HOVER;
      } else if (state == 1) {
        img = ImageResources.CHECKBOX_UNSELECTED;
      } else if (state == 4) {
        img = ImageResources.CHECKBOX_UNSELECTED_DISABLE;
      } else if (state == 3) {
        img = ImageResources.CHECKBOX_SELECTED_DISABLE;
      } else {
        return;
      }
      Rectangle imgRect = img.getBounds();
      int x = 0;
      int y = (height - height) / 2;
      if (getBackground() != null) {
        gc.setBackground(getBackground());
      }
      gc.fillRectangle(rect);
      gc.drawImage(img, x, y);
      if ((state == 3) || 
        (state == 4)) {
        gc.setForeground(ColorResources.CHECKBOX_DISABLED_FONT_COLOR);
      } else if (getForeground() != null) {
        gc.setForeground(getForeground());
      } else {
        gc.setForeground(ColorResources.BLACK);
      }
      int fontHeight = gc.getFontMetrics().getHeight();
      x = width + 4;
      y = (height - fontHeight) / 2;
      gc.drawText(text, x, y);
    }
  };
  protected Listener mouseListener = new Listener()
  {
    public void handleEvent(Event event)
    {
      if ((state == 3) || 
        (state == 4)) {
        return;
      }
      if ((type == 6) && 
        (state != 0)) {
        state = 2;
      }
      if ((type == 7) && 
        (state != 0)) {
        state = 1;
      }
      if ((type == 32) && 
        (state != 0)) {
        state = 2;
      }
      if (type == 4) {
        state = 0;
      }
      redraw();
    }
  };
  
  public void addSelectionListener(DACheckboxSelectionListener listener)
  {
    addListener(4, listener);
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckBox
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button.checkbox;

import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

public abstract class DACheckboxSelectionListener
  implements Listener
{
  public void handleEvent(Event event)
  {
    DACheckBox checkbox = (DACheckBox)widget;
    if (checkbox.isCheckboxEnabled()) {
      handleSelectionEvent(checkbox);
    }
  }
  
  public abstract void handleSelectionEvent(DACheckBox paramDACheckBox);
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckboxSelectionListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button.radio;

import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;

class DARadioButton$1
  implements PaintListener
{
  DARadioButton$1(DARadioButton paramDARadioButton) {}
  
  public void paintControl(PaintEvent e)
  {
    DARadioButton me = (DARadioButton)widget;
    Rectangle rect = me.getClientArea();
    Image img = null;
    if (DARadioButton.access$0(this$0) == 1) {
      img = ImageResources.RADIO_SELECTED;
    } else if (DARadioButton.access$0(this$0) == 2) {
      img = ImageResources.RADIO_UNSELECTED_HOVER;
    } else if (DARadioButton.access$0(this$0) == 0) {
      img = ImageResources.RADIO_UNSELECTED;
    } else {
      return;
    }
    Rectangle imgRect = img.getBounds();
    int x = 0;
    int y = (height - height) / 2;
    if (DARadioButton.access$1(this$0) != null) {
      gc.setBackground(DARadioButton.access$1(this$0));
    }
    gc.fillRectangle(rect);
    gc.drawImage(img, x, y);
    if (this$0.isEnabled())
    {
      if (DARadioButton.access$2(this$0) != null) {
        gc.setForeground(DARadioButton.access$2(this$0));
      }
    }
    else {
      gc.setForeground(ColorResources.BAR_GRAY1);
    }
    int fontHeight = gc.getFontMetrics().getHeight();
    x = width + 4;
    y = (height - fontHeight) / 2;
    gc.drawText(DARadioButton.access$3(this$0), x, y);
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.radio.DARadioButton.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button.radio;

import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

class DARadioButton$2
  implements Listener
{
  DARadioButton$2(DARadioButton paramDARadioButton) {}
  
  public void handleEvent(Event event)
  {
    DARadioButton radio = (DARadioButton)widget;
    if ((type == 6) && 
      (DARadioButton.access$0(this$0) != 1)) {
      DARadioButton.access$4(this$0, 2);
    }
    if ((type == 7) && 
      (DARadioButton.access$0(this$0) != 1)) {
      DARadioButton.access$4(this$0, 0);
    }
    if ((type == 32) && 
      (DARadioButton.access$0(this$0) != 1)) {
      DARadioButton.access$4(this$0, 2);
    }
    if (type == 4)
    {
      DARadioButton.access$5(this$0).setSelection(radio);
      DARadioButton.access$4(this$0, 1);
    }
    this$0.redraw();
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.radio.DARadioButton.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button.radio;

import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;

public class DARadioButton
  extends Canvas
{
  public static final int RADIO_UNSELECTED = 0;
  public static final int RADIO_SELECTED = 1;
  public static final int RADIO_UNSELECTED_HOVER = 2;
  private DARadioGroup parent = null;
  private String text = null;
  private int state = 0;
  private Color bgColor = null;
  private Color fgColor = null;
  
  public DARadioButton(Composite parent, int style)
  {
    super(parent, style);
    addPaintListener(radioPaintListener);
    addListener(6, mouseListener);
    addListener(7, mouseListener);
    addListener(4, mouseListener);
    text = "";
  }
  
  public void setForeground(Color color)
  {
    fgColor = color;
  }
  
  public void setBackground(Color color)
  {
    bgColor = color;
  }
  
  public void setText(String text)
  {
    this.text = text;
  }
  
  public String getText()
  {
    return text;
  }
  
  public void setParent(DARadioGroup parent)
  {
    this.parent = parent;
  }
  
  public void setSelection(boolean selected)
  {
    if (selected) {
      state = 1;
    } else {
      state = 0;
    }
  }
  
  private PaintListener radioPaintListener = new PaintListener()
  {
    public void paintControl(PaintEvent e)
    {
      DARadioButton me = (DARadioButton)widget;
      Rectangle rect = me.getClientArea();
      Image img = null;
      if (state == 1) {
        img = ImageResources.RADIO_SELECTED;
      } else if (state == 2) {
        img = ImageResources.RADIO_UNSELECTED_HOVER;
      } else if (state == 0) {
        img = ImageResources.RADIO_UNSELECTED;
      } else {
        return;
      }
      Rectangle imgRect = img.getBounds();
      int x = 0;
      int y = (height - height) / 2;
      if (bgColor != null) {
        gc.setBackground(bgColor);
      }
      gc.fillRectangle(rect);
      gc.drawImage(img, x, y);
      if (isEnabled())
      {
        if (fgColor != null) {
          gc.setForeground(fgColor);
        }
      }
      else {
        gc.setForeground(ColorResources.BAR_GRAY1);
      }
      int fontHeight = gc.getFontMetrics().getHeight();
      x = width + 4;
      y = (height - fontHeight) / 2;
      gc.drawText(text, x, y);
    }
  };
  protected Listener mouseListener = new Listener()
  {
    public void handleEvent(Event event)
    {
      DARadioButton radio = (DARadioButton)widget;
      if ((type == 6) && 
        (state != 1)) {
        state = 2;
      }
      if ((type == 7) && 
        (state != 1)) {
        state = 0;
      }
      if ((type == 32) && 
        (state != 1)) {
        state = 2;
      }
      if (type == 4)
      {
        parent.setSelection(radio);
        state = 1;
      }
      redraw();
    }
  };
  
  public void addSelectionListener(DARadioSelectionListener listener)
  {
    addListener(4, listener);
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.radio.DARadioButton
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button.radio;

import java.util.ArrayList;
import java.util.List;

public class DARadioGroup
{
  private int selection = 0;
  private List<DARadioButton> children = null;
  
  public void addChild(DARadioButton child)
  {
    getChildren().add(child);
    child.setParent(this);
    if (getChildren().size() == 1) {
      setSelection(child);
    }
  }
  
  private List<DARadioButton> getChildren()
  {
    if (children == null) {
      children = new ArrayList();
    }
    return children;
  }
  
  public void setSelection(DARadioButton selection)
  {
    int index = getChildren().indexOf(selection);
    int oldSelect = -1;
    if (index >= 0)
    {
      oldSelect = this.selection;
      this.selection = index;
      ((DARadioButton)getChildren().get(oldSelect)).setSelection(false);
      selection.setSelection(true);
      ((DARadioButton)getChildren().get(oldSelect)).redraw();
      selection.redraw();
    }
    else {}
  }
  
  public DARadioButton getSelection()
  {
    return (DARadioButton)getChildren().get(selection);
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.widgets.button.radio.DARadioGroup
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.widgets.button.radio;

import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

public abstrac
1 2 3 4 5 6 7 8 9 10 11

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd