org.eclipse.birt.chart.ui.extension_3.7.2.v20120213

16:41:28.654 INFO  jd.cli.Main - Decompiling org.eclipse.birt.chart.ui.extension_3.7.2.v20120213.jar
package org.eclipse.birt.chart.ui.event;

import java.util.Iterator;
import org.eclipse.birt.chart.model.Chart;
import org.eclipse.birt.chart.model.ChartWithAxes;
import org.eclipse.birt.chart.model.ChartWithoutAxes;
import org.eclipse.birt.chart.model.component.Axis;
import org.eclipse.birt.chart.model.data.SeriesDefinition;
import org.eclipse.birt.chart.model.layout.Block;
import org.eclipse.birt.chart.model.layout.LabelBlock;
import org.eclipse.birt.chart.model.layout.TitleBlock;
import org.eclipse.birt.chart.ui.swt.interfaces.IChangeListener;
import org.eclipse.birt.chart.ui.swt.interfaces.IUIManager;
import org.eclipse.emf.common.util.EList;

public class ChangeListenerImpl
  implements IChangeListener
{
  private transient int iBaseSeriesCount = 0;
  private transient int iOrthogonalSeriesCount = 0;
  private transient int iBaseAxisCount = 0;
  private transient int iOrthogonalAxisCount = 0;
  private transient int iLabelBlockCount = 0;
  private static final String BASE_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITH_AXES = "BaseSeriesSheetsCWA";
  private static final String ORTHOGONAL_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITH_AXES = "OrthogonalSeriesSheetsCWA";
  private static final String BASE_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITHOUT_AXES = "BaseSeriesSheetsCWOA";
  private static final String ORTHOGONAL_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITHOUT_AXES = "OrthogonalSeriesSheetsCWOA";
  private static final String BASE_AXIS_SHEET_COLLECTION = "BaseAxisSheets";
  private static final String ORTHOGONAL_AXIS_SHEET_COLLECTION = "OrthogonalAxisSheets";
  private static final String LABEL_BLOCK_SHEET_COLLECTION = "LabelBlockSeriesSheets";
  private static final String[] BASE_SERIES_SHEETS_FOR_CHARTS_WITH_AXES = {
    "Data.X Series", "Attributes.X Series" };
  private static final String[] ORTHOGONAL_SERIES_SHEETS_FOR_CHARTS_WITH_AXES = {
    "Data.Y Series", "Attributes.Y Series", "Attributes.Y Series.Labels" };
  private static final String[] BASE_SERIES_SHEETS_FOR_CHARTS_WITHOUT_AXES = {
    "Data.Base Series", "Attributes.Base Series" };
  private static final String[] ORTHOGONAL_SERIES_SHEETS_FOR_CHARTS_WITHOUT_AXES = {
    "Data.Orthogonal Series", "Attributes.Orthogonal Series", "Attributes.Orthogonal Series.Labels" };
  private static final String[] BASE_AXIS_SHEETS = {
    "Data.X Axis", "Attributes.X Axis", "Attributes.X Axis.Labels", "Attributes.X Axis.Markers" };
  private static final String[] ORTHOGONAL_AXIS_SHEETS = {
    "Data.Y Axis", "Attributes.Y Axis", "Attributes.Y Axis.Labels", "Attributes.Y Axis.Markers" };
  private static final String[] LABEL_BLOCK_SHEETS = {
    "Layout.Label Block" };
  
  public void initialize(Chart cModel, IUIManager uiManager)
  {
    uiManager.registerSheetCollection("BaseSeriesSheetsCWA", 
      BASE_SERIES_SHEETS_FOR_CHARTS_WITH_AXES);
    uiManager.registerSheetCollection("OrthogonalSeriesSheetsCWA", 
      ORTHOGONAL_SERIES_SHEETS_FOR_CHARTS_WITH_AXES);
    uiManager.registerSheetCollection("BaseSeriesSheetsCWOA", 
      BASE_SERIES_SHEETS_FOR_CHARTS_WITHOUT_AXES);
    uiManager.registerSheetCollection("OrthogonalSeriesSheetsCWOA", 
      ORTHOGONAL_SERIES_SHEETS_FOR_CHARTS_WITHOUT_AXES);
    uiManager.registerSheetCollection("BaseAxisSheets", BASE_AXIS_SHEETS);
    uiManager.registerSheetCollection("OrthogonalAxisSheets", ORTHOGONAL_AXIS_SHEETS);
    uiManager.registerSheetCollection("LabelBlockSeriesSheets", LABEL_BLOCK_SHEETS);
    
    iLabelBlockCount = 0;
    if ((cModel instanceof ChartWithAxes))
    {
      iBaseAxisCount = ((ChartWithAxes)cModel).getAxes().size();
      iOrthogonalAxisCount = 0;
      iBaseSeriesCount = 0;
      iOrthogonalSeriesCount = 0;
      for (int i = 0; i < iBaseAxisCount; i++)
      {
        iBaseSeriesCount += ((Axis)((ChartWithAxes)cModel).getAxes().get(i)).getSeriesDefinitions().size();
        iOrthogonalAxisCount += ((Axis)((ChartWithAxes)cModel).getAxes().get(i)).getAssociatedAxes().size();
        for (int iS = 0; iS < iOrthogonalAxisCount; iS++) {
          iOrthogonalSeriesCount = (iOrthogonalSeriesCount + ((Axis)((Axis)((ChartWithAxes)cModel).getAxes().get(i)).getAssociatedAxes().get(iS)).getSeriesDefinitions().size());
        }
      }
      for (int iBA = 1; iBA < iBaseAxisCount; iBA++) {
        uiManager.addCollectionInstance("BaseAxisSheets");
      }
      for (int iOA = 1; iOA < iOrthogonalAxisCount; iOA++) {
        uiManager.addCollectionInstance("OrthogonalAxisSheets");
      }
      uiManager.removeCollectionInstance("BaseSeriesSheetsCWOA");
      uiManager.removeCollectionInstance("OrthogonalSeriesSheetsCWOA");
      for (int iBS = 1; iBS < iBaseSeriesCount; iBS++) {
        uiManager.addCollectionInstance("BaseSeriesSheetsCWA");
      }
      for (int iOS = 1; iOS < iOrthogonalSeriesCount; iOS++) {
        uiManager.addCollectionInstance("OrthogonalSeriesSheetsCWA");
      }
    }
    else
    {
      iBaseAxisCount = 0;
      iOrthogonalAxisCount = 0;
      iBaseSeriesCount = ((ChartWithoutAxes)cModel).getSeriesDefinitions().size();
      iOrthogonalSeriesCount = 0;
      for (int iS = 0; iS < iBaseSeriesCount; iS++) {
        iOrthogonalSeriesCount = (iOrthogonalSeriesCount + ((SeriesDefinition)((ChartWithoutAxes)cModel).getSeriesDefinitions().get(iS)).getSeriesDefinitions().size());
      }
      uiManager.removeCollectionInstance("OrthogonalAxisSheets");
      uiManager.removeCollectionInstance("BaseAxisSheets");
      
      uiManager.removeCollectionInstance("BaseSeriesSheetsCWA");
      uiManager.removeCollectionInstance("OrthogonalSeriesSheetsCWA");
      for (int iBS = 1; iBS < iBaseSeriesCount; iBS++) {
        uiManager.addCollectionInstance("BaseSeriesSheetsCWOA");
      }
      for (int iOS = 1; iOS < iOrthogonalSeriesCount; iOS++) {
        uiManager.addCollectionInstance("OrthogonalSeriesSheetsCWOA");
      }
    }
    Iterator iter = cModel.getBlock().getChildren().iterator();
    while (iter.hasNext())
    {
      Block block = (Block)iter.next();
      if (((block instanceof LabelBlock)) && (!(block instanceof TitleBlock))) {
        iLabelBlockCount += 1;
      }
    }
    if (iLabelBlockCount == 0) {
      uiManager.removeCollectionInstance("LabelBlockSeriesSheets");
    } else {
      for (int iLB = 1; iLB < iLabelBlockCount; iLB++) {
        uiManager.addCollectionInstance("LabelBlockSeriesSheets");
      }
    }
  }
  
  public void chartModified(Chart cModel, IUIManager uiManager)
  {
    int iNewBaseAxisCount = 0;
    int iNewOrthogonalAxisCount = 0;
    int iNewBaseSeriesCount = 0;
    int iNewOrthogonalSeriesCount = 0;
    if ((cModel instanceof ChartWithAxes))
    {
      iNewBaseAxisCount = ((ChartWithAxes)cModel).getAxes().size();
      iNewOrthogonalAxisCount = 0;
      iNewBaseSeriesCount = 0;
      iNewOrthogonalSeriesCount = 0;
      for (int i = 0; i < iNewBaseAxisCount; i++)
      {
        iNewBaseSeriesCount += ((Axis)((ChartWithAxes)cModel).getAxes().get(i)).getSeriesDefinitions().size();
        
        iNewOrthogonalAxisCount = iNewOrthogonalAxisCount + ((Axis)((ChartWithAxes)cModel).getAxes().get(i)).getAssociatedAxes().size();
        for (int iS = 0; iS < iNewOrthogonalAxisCount; iS++) {
          iNewOrthogonalSeriesCount = iNewOrthogonalSeriesCount + ((Axis)((Axis)((ChartWithAxes)cModel).getAxes().get(i)).getAssociatedAxes().get(iS)).getSeriesDefinitions().size();
        }
      }
      if (iNewBaseAxisCount >= iBaseAxisCount) {
        for (int iBA = iBaseAxisCount; iBA < iNewBaseAxisCount; iBA++) {
          uiManager.addCollectionInstance("BaseAxisSheets");
        }
      } else {
        for (int iBA = iBaseAxisCount; iBA > iNewBaseAxisCount; iBA--) {
          uiManager.removeCollectionInstance("BaseAxisSheets");
        }
      }
      if (iNewOrthogonalAxisCount >= iOrthogonalAxisCount) {
        for (int iOA = iOrthogonalAxisCount; iOA < iNewOrthogonalAxisCount; iOA++) {
          uiManager.addCollectionInstance("OrthogonalAxisSheets");
        }
      } else {
        for (int iOA = iOrthogonalAxisCount; iOA > iNewOrthogonalAxisCount; iOA--) {
          uiManager.removeCollectionInstance("OrthogonalAxisSheets");
        }
      }
    }
    else
    {
      iNewBaseAxisCount = 0;
      iNewOrthogonalAxisCount = 0;
      iNewBaseSeriesCount = ((ChartWithoutAxes)cModel).getSeriesDefinitions().size();
      iNewOrthogonalSeriesCount = 0;
      for (int iS = 0; iS < iNewBaseSeriesCount; iS++) {
        iNewOrthogonalSeriesCount = iNewOrthogonalSeriesCount + ((SeriesDefinition)((ChartWithoutAxes)cModel).getSeriesDefinitions().get(iS)).getSeriesDefinitions().size();
      }
    }
    Iterator iter = cModel.getBlock().getChildren().iterator();
    while (iter.hasNext())
    {
      Block block = (Block)iter.next();
      if ((!(block instanceof LabelBlock)) || ((block instanceof TitleBlock))) {}
    }
    if ((cModel instanceof ChartWithAxes))
    {
      if (iNewBaseSeriesCount >= iBaseSeriesCount) {
        for (int iBS = iBaseSeriesCount; iBS < iNewBaseSeriesCount; iBS++) {
          uiManager.addCollectionInstance("BaseSeriesSheetsCWA");
        }
      } else {
        for (int iBS = iBaseSeriesCount; iBS > iNewBaseSeriesCount; iBS--) {
          uiManager.removeCollectionInstance("BaseSeriesSheetsCWA");
        }
      }
      if (iNewOrthogonalSeriesCount >= iOrthogonalSeriesCount) {
        for (int iOS = iOrthogonalSeriesCount; iOS < iNewOrthogonalSeriesCount; iOS++) {
          uiManager.addCollectionInstance("OrthogonalSeriesSheetsCWA");
        }
      } else {
        for (int iOS = iOrthogonalSeriesCount; iOS > iNewOrthogonalSeriesCount; iOS--) {
          uiManager.removeCollectionInstance("OrthogonalSeriesSheetsCWA");
        }
      }
    }
    else
    {
      if (iNewBaseSeriesCount >= iBaseSeriesCount) {
        for (int iBS = iBaseSeriesCount; iBS < iNewBaseSeriesCount; iBS++) {
          uiManager.addCollectionInstance("BaseSeriesSheetsCWOA");
        }
      } else {
        for (int iBS = iBaseSeriesCount; iBS > iNewBaseSeriesCount; iBS--) {
          uiManager.removeCollectionInstance("BaseSeriesSheetsCWOA");
        }
      }
      if (iNewOrthogonalSeriesCount >= iOrthogonalSeriesCount) {
        for (int iOS = iOrthogonalSeriesCount; iOS < iNewOrthogonalSeriesCount; iOS++) {
          uiManager.addCollectionInstance("OrthogonalSeriesSheetsCWOA");
        }
      } else {
        for (int iOS = iOrthogonalSeriesCount; iOS > iNewOrthogonalSeriesCount; iOS--) {
          uiManager.removeCollectionInstance("OrthogonalSeriesSheetsCWOA");
        }
      }
    }
    iBaseAxisCount = iNewBaseAxisCount;
    iOrthogonalAxisCount = iNewOrthogonalAxisCount;
    iBaseSeriesCount = iNewBaseSeriesCount;
    iOrthogonalSeriesCount = iNewOrthogonalSeriesCount;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.ui.event.ChangeListenerImpl
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.ui.extension.i18n;

import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.UResourceBundle;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class Messages
{
  private static final String BUNDLE_NAME = "org.eclipse.birt.chart.ui.extension.i18n.nls";
  private static final ResourceBundle RESOURCE_BUNDLE = UResourceBundle.getBundleInstance("org.eclipse.birt.chart.ui.extension.i18n.nls", 
    ULocale.getDefault(), 
    Messages.class.getClassLoader());
  
  public static ResourceBundle getResourceBundle()
  {
    return RESOURCE_BUNDLE;
  }
  
  public static String getString(String key)
  {
    try
    {
      return RESOURCE_BUNDLE.getString(key);
    }
    catch (MissingResourceException localMissingResourceException) {}
    return '!' + key + '!';
  }
  
  public static String getFormattedString(String key, Object[] arguments)
  {
    return MessageFormat.format(getString(key), arguments);
  }
  
  public static String getFormattedString(String key, String argument)
  {
    return MessageFormat.format(getString(key), new Object[] {
      argument });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.ui.extension.i18n.Messages
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.ui.plugin;

import org.eclipse.ui.plugin.AbstractUIPlugin;

public class ChartUIExtensionPlugin
  extends AbstractUIPlugin
{
  public static final String ID = "org.eclipse.birt.chart.ui.extension";
  private static ChartUIExtensionPlugin plugin = null;
  
  public ChartUIExtensionPlugin()
  {
    plugin = this;
  }
  
  public static AbstractUIPlugin getDefault()
  {
    return plugin;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.ui.plugin.ChartUIExtensionPlugin
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.ui.swt;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.eclipse.birt.chart.model.attribute.ColorDefinition;
import org.eclipse.birt.chart.model.attribute.FontDefinition;
import org.eclipse.birt.chart.model.attribute.Insets;
import org.eclipse.birt.chart.model.data.DataElement;
import org.eclipse.birt.chart.model.data.DateTimeDataElement;
import org.eclipse.birt.chart.ui.integrate.ChartUIHelperBase;
import org.eclipse.birt.chart.ui.swt.composites.DateTimeDataElementComposite;
import org.eclipse.birt.chart.ui.swt.composites.FontDefinitionDialog;
import org.eclipse.birt.chart.ui.swt.composites.HeadStyleChooserComposite;
import org.eclipse.birt.chart.ui.swt.composites.InsetsComposite;
import org.eclipse.birt.chart.ui.swt.composites.IntegerSpinControl;
import org.eclipse.birt.chart.ui.swt.composites.LineStyleChooserComposite;
import org.eclipse.birt.chart.ui.swt.composites.LineWidthChooserComposite;
import org.eclipse.birt.chart.ui.swt.composites.LocalizedNumberEditorComposite;
import org.eclipse.birt.chart.ui.swt.composites.NumberDataElementComposite;
import org.eclipse.birt.chart.ui.swt.composites.TextEditorComposite;
import org.eclipse.birt.chart.ui.swt.interfaces.IChartUIFactory;
import org.eclipse.birt.chart.ui.swt.interfaces.IChartUIHelper;
import org.eclipse.birt.chart.ui.swt.interfaces.IDataElementComposite;
import org.eclipse.birt.chart.ui.swt.interfaces.IFontDefinitionDialog;
import org.eclipse.birt.chart.ui.swt.interfaces.IUIServiceProvider;
import org.eclipse.birt.chart.ui.swt.wizard.ChartWizardContext;
import org.eclipse.birt.chart.util.TriggerSupportMatrix;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;

public class ChartUIFactory
  implements IChartUIFactory
{
  public IChartUIHelper createUIHelper()
  {
    return new ChartUIHelperBase();
  }
  
  public TriggerSupportMatrix createSupportMatrix(String outputFormat, int iType)
  {
    return new TriggerSupportMatrix(outputFormat, iType);
  }
  
  public ChartCheckbox createChartCheckbox(Composite parent, int styles, boolean defaultSelection)
  {
    return new ChartCheckbox(parent, styles, defaultSelection);
  }
  
  public ChartSpinner createChartSpinner(Composite parent, int styles, EObject obj, String property, boolean enabled)
  {
    return new ChartSpinner(parent, styles, obj, property, enabled);
  }
  
  public ChartSpinner createChartSpinner(Composite parent, int styles, EObject obj, String property, boolean enabled, String label, String endLabel)
  {
    return new ChartSpinner(parent, styles, obj, property, enabled, label, endLabel);
  }
  
  public AbstractChartInsets createChartInsetsComposite(Composite parent, int style, int numberRows, Insets insets, String sUnits, IUIServiceProvider serviceprovider, ChartWizardContext context, Insets defInsets)
  {
    InsetsComposite insetsComp = new InsetsComposite(parent, 
      style, 
      numberRows, 
      insets, 
      sUnits, 
      serviceprovider, 
      context);
    insetsComp.setDefaultInsets(defInsets);
    return insetsComp;
  }
  
  public AbstractChartIntSpinner createChartIntSpinner(Composite parent, int style, int iCurrentValue, EObject obj, String property, boolean enabled)
  {
    AbstractChartIntSpinner cis = new IntegerSpinControl(parent, style, iCurrentValue);
    cis.setEnabled(enabled);
    return cis;
  }
  
  public IDataElementComposite createNumberDataElementComposite(Composite parent, DataElement data, EObject eParent, String sProperty)
  {
    return new NumberDataElementComposite(parent, data);
  }
  
  public IDataElementComposite createDateTimeDataElementComposite(Composite parent, int style, DateTimeDataElement data, boolean isNullAllowed, EObject eParent, String sProperty)
  {
    return new DateTimeDataElementComposite(parent, style, data, isNullAllowed);
  }
  
  public ChartCombo createChartCombo(Composite parent, int style, EObject eParent, String sProperty, String defaultItem)
  {
    return new ChartCombo(parent, style, eParent, sProperty, defaultItem);
  }
  
  public AbstractLineStyleChooserComposite createLineStyleChooserComposite(Composite parent, int style, int iLineStyle, Integer[] lineStyleItems, EObject eParent, String sProperty)
  {
    return new LineStyleChooserComposite(parent, style, iLineStyle, lineStyleItems);
  }
  
  public AbstractLineWidthChooserComposite createLineWidthChooserComposite(Composite parent, int style, int iWidth, Integer[] lineWidths, EObject eParent, String sProperty)
  {
    return new LineWidthChooserComposite(parent, style, iWidth, lineWidths);
  }
  
  public boolean canEnableUI(ChartCheckbox button)
  {
    return button.getSelectionState() == 1;
  }
  
  public AbstractHeadStyleChooserComposite createHeadStyleChooserComposite(Composite parent, int style, int iLineDecorator, EObject eParent, String sProperty)
  {
    return new HeadStyleChooserComposite(parent, style, iLineDecorator);
  }
  
  public IFontDefinitionDialog createFontDefinitionDialog(Shell shellParent, ChartWizardContext wizardContext, FontDefinition fdCurrent, ColorDefinition cdCurrent, boolean isAlignmentEnabled)
  {
    return new FontDefinitionDialog(shellParent, wizardContext, fdCurrent, cdCurrent, isAlignmentEnabled);
  }
  
  public AbstractChartTextEditor createChartTextEditor(Composite parent, int style, EObject eParent, String sProperty)
  {
    return new TextEditorComposite(parent, style);
  }
  
  public AbstractChartNumberEditor createChartNumberEditor(Composite parent, int style, String sUnit, EObject eParent, String sProperty)
  {
    return new LocalizedNumberEditorComposite(parent, style, sUnit);
  }
  
  public ChartSlider createChartSlider(Composite parent, int style, EObject eParent, String sProperty)
  {
    return new ChartSlider(parent, style);
  }
  
  public boolean supportAutoUI()
  {
    return false;
  }
  
  public boolean isSetInvisible(EObject obj)
  {
    boolean isSetInvisible = false;
    try
    {
      Method m = obj.getClass().getMethod("isVisible", new Class[0]);
      isSetInvisible = !((Boolean)m.invoke(obj, new Object[0])).booleanValue();
    }
    catch (SecurityException localSecurityException) {}catch (NoSuchMethodException localNoSuchMethodException) {}catch (IllegalArgumentException localIllegalArgumentException) {}catch (IllegalAccessException localIllegalAccessException) {}catch (InvocationTargetException localInvocationTargetException) {}
    return isSetInvisible;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.ui.swt.ChartUIFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.ui.swt.composites;

import org.eclipse.swt.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleEvent;

class AngleSelectorComposite$1
  extends AccessibleAdapter
{
  AngleSelectorComposite$1(AngleSelectorComposite paramAngleSelectorComposite) {}
  
  public void getHelp(AccessibleEvent e)
  {
    result = this$0.getToolTipText();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.ui.swt.composites.AngleSelectorComposite.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.ui.swt.composites;

import org.eclipse.swt.accessibility.AccessibleControlAdapter;
import org.eclipse.swt.accessibility.AccessibleControlEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;

class AngleSelectorComposite$2
  extends AccessibleControlAdapter
{
  AngleSelectorComposite$2(AngleSelectorComposite paramAngleSelectorComposite) {}
  
  public void getChildAtPoint(AccessibleControlEvent e)
  {
    Point testPoint = this$0.toControl(new Point(x, y));
    if (this$0.getBounds().contains(testPoint)) {
      childID = -1;
    }
  }
  
  public void getLocation(AccessibleControlEvent e)
  {
    Rectangle location = this$0.getBounds();
    Point pt = this$0.toDisplay(new Point(x, y));
    x = x;
    y = y;
    width = width;
    height = height;
  }
  
  public void getChildCount(AccessibleControlEvent e)
  {
    detail = 0;
  }
  
  public void getRole(AccessibleControlEvent e)
  {
    detail = 46;
  }
  
  public void getState(AccessibleControlEvent e)
  {
    detail = 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.ui.swt.composites.AngleSelectorComposite.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.ui.swt.composites;

import org.eclipse.swt.accessibility.Accessible;
import org.eclipse.swt.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleControlAdapter;
import org.eclipse.swt.accessibility.AccessibleControlEvent;
import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Color;
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.Composite;
import org.eclipse.swt.widgets.Display;

public final class AngleSelectorComposite
  extends Canvas
  implements PaintListener, MouseListener, MouseMoveListener, DisposeListener, ControlListener
{
  private final transient Point p = new Point(0, 0);
  private transient int iLastAngle = 0;
  private transient int iRadius = 0;
  private transient boolean bMouseDown = false;
  private transient IAngleChangeListener iacl = null;
  private transient Color clrBG = null;
  private Image imgBuffer = null;
  private GC gcBuffer = null;
  private final transient int[] iaPolygon = new int[6];
  
  public AngleSelectorComposite(Composite coParent, int iStyle, int iAngle, Color clrBG)
  {
    super(coParent, iStyle);
    iLastAngle = iAngle;
    addPaintListener(this);
    addMouseListener(this);
    addDisposeListener(this);
    addControlListener(this);
    addMouseMoveListener(this);
    initAccessible();
    this.clrBG = clrBG;
    setBackground(clrBG);
  }
  
  public void paintControl(PaintEvent pev)
  {
    Display d = Display.getCurrent();
    GC gcCanvas = gc;
    Rectangle rCA = getClientArea();
    int iWidth = height / 2 - 8;
    int iHeight = height - 16;
    if (imgBuffer == null)
    {
      imgBuffer = new Image(d, width, height);
      gcBuffer = new GC(imgBuffer);
    }
    if (!isEnabled()) {
      gcBuffer.setBackground(d.getSystemColor(22));
    } else {
      gcBuffer.setBackground(clrBG);
    }
    gcBuffer.setForeground(d.getSystemColor(15));
    gcBuffer.fillRectangle(rCA);
    
    p.x = 10;
    p.y = (iHeight / 2 + 8);
    
    gcBuffer.setForeground(d.getSystemColor(2));
    gcBuffer.setBackground(d.getSystemColor(3));
    for (int i = -90; i <= 90; i += 15)
    {
      double dRadians = Math.toRadians(i);
      int x = (int)(p.x + iWidth * Math.cos(dRadians));
      int y = (int)(p.y - iWidth * Math.sin(dRadians));
      if (i % 45 == 0) {
        bigPoint(d, gcBuffer, x, y, i == iLastAngle);
      } else {
        smallPoint(d, gcBuffer, x, y, i == iLastAngle);
      }
    }
    iRadius = iWidth;
    drawHand(d, gcBuffer, p.x, p.y, iRadius - 10, iLastAngle, false);
    
    gcCanvas.drawImage(imgBuffer, 0, 0);
  }
  
  private static final void bigPoint(Display d, GC gc, int x, int y, boolean bSelected)
  {
    gc.setForeground(d.getSystemColor(2));
    gc.setBackground(d.getSystemColor(bSelected ? 3 : 2));
    int[] iaXY = 
      {
      x, y - 3, x - 3, y, x, y + 3, x + 3, y };
    
    gc.fillPolygon(iaXY);
    gc.drawPolygon(iaXY);
  }
  
  private static final void smallPoint(Display d, GC gc, int x, int y, boolean bSelected)
  {
    gc.setForeground(d.getSystemColor(bSelected ? 3 : 2));
    gc.drawRectangle(x - 1, y - 1, 1, 1);
  }
  
  private final void drawHand(Display d, GC gc, int x, int y, int r, double dAngleInDegrees, boolean bErase)
  {
    gc.setForeground(bErase ? clrBG : d.getSystemColor(2));
    gc.setBackground(bErase ? clrBG : d.getSystemColor(3));
    
    double dAngleInRadians = Math.toRadians(dAngleInDegrees);
    int rMinus = r - 10;
    double dAngleInRadiansMinus = Math.toRadians(dAngleInDegrees - 3.0D);
    double dAngleInRadiansPlus = Math.toRadians(dAngleInDegrees + 3.0D);
    int xTip = (int)(x + r * Math.cos(dAngleInRadians));
    int yTip = (int)(y - r * Math.sin(dAngleInRadians));
    
    gc.drawLine(x, y, xTip, yTip);
    
    iaPolygon[0] = xTip;
    iaPolygon[1] = yTip;
    iaPolygon[2] = ((int)(x + rMinus * Math.cos(dAngleInRadiansMinus)));
    iaPolygon[3] = ((int)(y - rMinus * Math.sin(dAngleInRadiansMinus)));
    iaPolygon[4] = ((int)(x + rMinus * Math.cos(dAngleInRadiansPlus)));
    iaPolygon[5] = ((int)(y - rMinus * Math.sin(dAngleInRadiansPlus)));
    gc.fillPolygon(iaPolygon);
    gc.drawPolygon(iaPolygon);
  }
  
  public void mouseDoubleClick(MouseEvent arg0) {}
  
  public void mouseDown(MouseEvent mev)
  {
    bMouseDown = true;
    updateAngle(x, y);
  }
  
  public void mouseUp(MouseEvent mev)
  {
    bMouseDown = false;
  }
  
  public void mouseMove(MouseEvent mev)
  {
    if (!bMouseDown) {
      return;
    }
    updateAngle(x, y);
  }
  
  private final void updateAngle(int mx, int my)
  {
    int iAngle = (int)Math.toDegrees(Math.atan2(-(my - p.y), mx - p.x));
    if (iAngle > 90) {
      iAngle = 90;
    }
    if (iAngle < -90) {
      iAngle = -90;
    }
    if (iAngle == iLastAngle) {
      return;
    }
    Display d = Display.getCurrent();
    GC gc = new GC(this);
    
    drawHand(d, gc, p.x, p.y, iRadius - 10, iLastAngle, true);
    if (iLastAngle % 45 == 0)
    {
      int x = (int)(p.x + iRadius * Math.cos(Math.toRadians(iLastAngle)));
      int y = (int)(p.y - iRadius * Math.sin(Math.toRadians(iLastAngle)));
      bigPoint(d, gc, x, y, false);
    }
    else if (iLastAngle % 15 == 0)
    {
      int x = (int)(p.x + iRadius * Math.cos(Math.toRadians(iLastAngle)));
      int y = (int)(p.y - iRadius * Math.sin(Math.toRadians(iLastAngle)));
      smallPoint(d, gc, x, y, false);
    }
    iLastAngle = iAngle;
    drawHand(d, gc, p.x, p.y, iRadius - 10, iLastAngle, false);
    if (iLastAngle % 45 == 0)
    {
      int x = (int)(p.x + iRadius * Math.cos(Math.toRadians(iLastAngle)));
      int y = (int)(p.y - iRadius * Math.sin(Math.toRadians(iLastAngle)));
      bigPoint(d, gc, x, y, true);
    }
    else if (iLastAngle % 15 == 0)
    {
      int x = (int)(p.x + iRadius * Math.cos(Math.toRadians(iLastAngle)));
      int y = (int)(p.y - iRadius * Math.sin(Math.toRadians(iLastAngle)));
      smallPoint(d, gc, x, y, true);
    }
    gc.dispose();
    if (iacl != null) {
      iacl.angleChanged(iAngle);
    }
  }
  
  public final void setAngleChangeListener(IAngleChangeListener iacl)
  {
    this.iacl = iacl;
  }
  
  public void setAngle(int iNewAngle)
  {
    iLastAngle = iNewAngle;
  }
  
  public void widgetDisposed(DisposeEvent e)
  {
    if (imgBuffer != null)
    {
      gcBuffer.dispose();
      imgBuffer.dispose();
      gcBuffer = null;
      imgBuffer = null;
    }
  }
  
  public void controlResized(ControlEvent e)
  {
    if (imgBuffer != null)
    {
      gcBuffer.dispose();
      imgBuffer.dispose();
      gcBuffer = null;
      imgBuffer = null;
    }
  }
  
  public void controlMoved(ControlEvent e) {}
  
  void initAccessible()
  {
    getAccessible().addAccessibleListener(new AccessibleAdapter()
    {
      public void getHelp(AccessibleEvent e)
      {
        result = getToolTipText();
      }
    });
    getAccessible().addAccessibleControlListener(new AccessibleControlAdapter()
    {
      public void getChildAtPoint(AccessibleControlEvent e)
      {
        Point testPoint = toControl(new Point(x, y));
        if (getBounds().contains(testPoint)) {
          childID = -1;
        }
      }
      
      public void getLocation(AccessibleControlEvent e)
      {
        Rectangle location = getBounds();
        Point pt = toDisplay(new Point(x, y));
        x = x;
        y = y;
        width = width;
        height = height;
      }
      
      public void getChildCount(AccessibleControlEvent e)
      {
        detail = 0;
      }
      
      public void getRole(AccessibleControlEvent e)
      {
        detail = 46;
      }
      
      public void getState(AccessibleControlEvent e)
      {
        detail = 0;
      }
    });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.ui.swt.composites.AngleSelectorComposite
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.ui.swt.composites;

import java.util.LinkedHashSet;
import java.util.Set;
import org.eclipse.birt.chart.model.data.SeriesDefinition;
import org.eclipse.birt.chart.ui.swt.wizard.ChartWizardContext;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;

public class BaseGroupSortingDialog
  extends GroupSortingDialog
{
  public BaseGroupSortingDialog(Shell shell, ChartWizardContext wizardContext, SeriesDefinition sd)
  {
    super(shell, wizardContext, sd);
  }
  
  public void createSortArea(Composite parent)
  {
    super.createSortArea(parent);
    if (onlyCategoryExprAsCategorySortKey()) {
      setSortKeySelectionState(false);
    }
  }
  
  protected Set<String> getSortKeySet()
  {
    Set<String> exprSet = new LinkedHashSet();
    if (onlyCategoryExprAsCategorySortKey())
    {
      exprSet.add((String)getBaseSeriesExpression().toArray()[0]);
    }
    else
    {
      exprSet.addAll(getBaseSeriesExpression());
      exprSet.addAll(getValueSeriesExpressions());
    }
    return exprSet;
  }
  
  protected void updateSortKeySelectionState()
  {
    setSortKeySelectionState((isSortEnabled()) && 
      (!onlyCategoryExprAsCategorySortKey()));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.ui.swt.composites.BaseGroupSortingDialog
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.ui.swt.composites;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class CursorImageDialog$1
  implements ModifyListener
{
  CursorImageDialog$1(CursorImageDialog paramCursorImageDialog) {}
  
  public void modifyText(ModifyEvent e)
  {
    CursorImageDialog.access$0(this$0);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.ui.swt.composites.CursorImageDialog.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.ui.swt.composites;

import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.widgets.Text;

class CursorImageDialog$2
  extends FocusAdapter
{
  CursorImageDialog$2(CursorImageDialog paramCursorImageDialog) {}
  
  public void focusLost(FocusEvent e)
  {
    CursorImageDialog.access$2(this$0, this$0.removeQuote(CursorImageDialog.access$1(this$0).getText()));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.ui.swt.composites.CursorImageDialog.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.ui.swt.composites;

import java.net.URI;
import org.eclipse.birt.chart.model.attribute.Cursor;
import org.eclipse.birt.chart.model.attribute.Image;
import org.eclipse.birt.chart.model.attribute.impl.ImageImpl;
import org.eclipse.birt.chart.ui.extension.i18n.Messages;
import org.eclipse.emf.common.util.EList;
import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

public class CursorImageDialog
  extends TrayDialog
  implements SelectionListener
{
  private Composite inputArea;
  private IconCanvas previewCanvas;
  private Text txtUriEditor;
  private Button btnPreview;
  private Cursor cursor;
  private Label title;
  
  public CursorImageDialog(Shell parentShell, Cursor cursor)
  {
    super(parentShell);
    this.cursor = cursor;
  }
  
  protected Control createContents(Composite parent)
  {
    Control ct = super.createContents(parent);
    
    initDialog();
    return ct;
  }
  
  protected Control createDialogArea(Composite parent)
  {
    Composite topCompostie = (Composite)super.createDialogArea(parent);
    Composite composite = new Composite(topCompostie, 0);
    composite.setLayout(new GridLayout(1, false));
    
    createInputArea(composite);
    createPreviewArea(composite);
    
    new Label(topCompostie, 258).setLayoutData(new GridData(768));
    
    return topCompostie;
  }
  
  private void createInputArea(Composite parent)
  {
    inputArea = new Composite(parent, 0);
    GridData gd = new GridData(768);
    inputArea.setLayoutData(gd);
    GridLayout gl = new GridLayout();
    numColumns = 2;
    inputArea.setLayout(gl);
    
    title = new Label(inputArea, 0);
    gd = new GridData(768);
    horizontalSpan = 2;
    title.setLayoutData(gd);
    
    Label l = new Label(inputArea, 0);
    gd = new GridData(768);
    horizontalSpan = 2;
    l.setLayoutData(gd);
    l.setText(Messages.getString("ImageDialog.uri.tooltip"));
    
    txtUriEditor = new Text(inputArea, 2052);
    txtUriEditor.setLayoutData(new GridData(768));
    txtUriEditor.addModifyListener(new ModifyListener()
    {
      public void modifyText(ModifyEvent e)
      {
        CursorImageDialog.this.updateButtons();
      }
    });
    txtUriEditor.addFocusListener(new FocusAdapter()
    {
      public void focusLost(FocusEvent e)
      {
        CursorImageDialog.this.preview(removeQuote(txtUriEditor.getText()));
      }
    });
    btnPreview = new Button(inputArea, 0);
    gd = new GridData();
    btnPreview.setLayoutData(gd);
    btnPreview.addSelectionListener(this);
    btnPreview.setText(Messages.getString("ImageDialog.label.Preview"));
  }
  
  private void createPreviewArea(Composite composite)
  {
    Composite previewArea = new Composite(composite, 2048);
    GridData gd = new GridData(1808);
    widthHint = 250;
    heightHint = 200;
    previewArea.setLayoutData(gd);
    previewArea.setLayout(new FillLayout());
    
    previewCanvas = new IconCanvas(previewArea);
    previewCanvas.setSize(250, 200);
  }
  
  protected void okPressed()
  {
    if (cursor.getImage().size() > 0) {
      cursor.getImage().clear();
    }
    cursor.getImage().add(0, ImageImpl.create(txtUriEditor.getText()));
    
    super.okPressed();
  }
  
  protected boolean initDialog()
  {
    getShell().setText(Messages.getString("ImageDialog.label.SelectImage"));
    title.setText(Messages.getString("ImageDialog.label.EnterURL"));
    getButton(0).setEnabled(false);
    initURIEditor();
    return true;
  }
  
  private void initURIEditor()
  {
    String uri = "";
    if (cursor.getImage().size() > 0) {
      uri = ((Image)cursor.getImage().get(0)).getURL();
    }
    txtUriEditor.setText(uri);
    txtUriEditor.setFocus();
    
    updateButtons();
    preview(removeQuote(txtUriEditor.getText()));
  }
  
  private void updateButtons()
  {
    boolean complete = (txtUriEditor.getText() != null) && 
      (txtUriEditor.getText().trim().length() > 0);
    
    btnPreview.setEnabled(complete);
    getButton(0).setEnabled(complete);
  }
  
  public String removeQuote(String string)
  {
    if ((string != null) && 
      (string.length() >= 2) && 
      (string.startsWith("\"")) && 
      (string.endsWith("\""))) {
      return string.substring(1, string.length() - 1);
    }
    return string;
  }
  
  private void preview(String uri)
  {
    try
    {
      previewCanvas.loadImage(new URI(uri).toURL());
    }
    catch (Exception localException) {}
  }
  
  public void widgetDefaultSelected(SelectionEvent e) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    Object source = e.getSource();
    if (source == btnPreview) {
      preview(removeQuote(txtUriEditor.getText()));
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.ui.swt.composites.CursorImageDialog
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.ui.swt.composites;

class DataItemCombo$1$1
  implements Runnable
{
  DataItemCombo$1$1(DataItemCombo.1 param1) {}
  
  public void run()
  {
    if (DataItemCombo.1.access$0(this$1).isDisposed()) {
      return;
    }
    DataItemCombo.1.access$0(this$1).handleFocus(16);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.ui.swt.composites.DataItemCombo.1.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.ui.swt.composites;

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

class DataItemCombo$1
  implements Listener
{
  DataItemCombo$1(DataItemCombo paramDataItemCombo) {}
  
  public void handleEvent(Event event)
  {
    if (this$0.isDisposed()) {
      return;
    }
    if (this$0.popup == widget)
    {
      this$0.popupEvent(event);
      return;
    }
    if (this$0.text == widget)
    {
      this$0.textEvent(event);
      return;
    }
    if (this$0.list == widget)
    {
      this$0.listEvent(event);
      return;
    }
    if (this$0.arrow == widget)
    {
      this$0.arrowEvent(event);
      return;
    }
    if (this$0 == widget)
    {
      this$0.comboEvent(event);
      return;
    }
    if (this$0.getShell() == widget) {
      this$0.getDisplay().asyncExec(new Runnable()
      {
        public void run()
        {
          if (this$0.isDisposed()) {
            return;
          }
          this$0.handleFocus(16);
        }
      });
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.ui.swt.composites.DataItemCombo.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.ui.swt.composites;

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

class DataItemCombo$2
  implements Listener
{
  DataItemCombo$2(DataItemCombo paramDataItemCombo) {}
  
  public void handleEvent(Event event)
  {
    if (this$0.isDisposed()) {
      return;
    }
    Shell shell = ((Control)widget).getShell(
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48

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