Example usage for org.eclipse.jface.preference IPreferenceStore getInt

List of usage examples for org.eclipse.jface.preference IPreferenceStore getInt

Introduction

In this page you can find the example usage for org.eclipse.jface.preference IPreferenceStore getInt.

Prototype

int getInt(String name);

Source Link

Document

Returns the current value of the integer-valued preference with the given name.

Usage

From source file:de.gulden.modeling.wave.diagram.providers.WaveViewProvider.java

License:Open Source License

/**
 * @generated/*from w  w  w  .j  a v  a 2 s.c  om*/
 */
public Edge createAssociationRelationship_3004(EObject domainElement, View containerView, int index,
        boolean persisted, PreferencesHint preferencesHint) {
    Connector edge = NotationFactory.eINSTANCE.createConnector();
    edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
    RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
    ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
    points.add(new RelativeBendpoint());
    points.add(new RelativeBendpoint());
    bendpoints.setPoints(points);
    edge.setBendpoints(bendpoints);
    ViewUtil.insertChildView(containerView, edge, index, persisted);
    edge.setType(WaveVisualIDRegistry.getType(AssociationRelationshipEditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // initializePreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
            IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
            FigureUtilities.RGBToInteger(lineRGB));
    FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
    if (edgeFontStyle != null) {
        FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
        edgeFontStyle.setFontName(fontData.getName());
        edgeFontStyle.setFontHeight(fontData.getHeight());
        edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
        edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
        org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
                IPreferenceConstants.PREF_FONT_COLOR);
        edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
    }
    Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
    if (routing != null) {
        ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
    }
    Node label4008 = createLabel(edge,
            WaveVisualIDRegistry.getType(AssociationRelationshipNameEditPart.VISUAL_ID));
    label4008.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location4008 = (Location) label4008.getLayoutConstraint();
    location4008.setX(0);
    location4008.setY(40);
    Node label4009 = createLabel(edge,
            WaveVisualIDRegistry.getType(AssociationRelationshipMultiplicityAEditPart.VISUAL_ID));
    label4009.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location4009 = (Location) label4009.getLayoutConstraint();
    location4009.setX(0);
    location4009.setY(60);
    Node label4010 = createLabel(edge,
            WaveVisualIDRegistry.getType(AssociationRelationshipMultiplicityBEditPart.VISUAL_ID));
    label4010.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location4010 = (Location) label4010.getLayoutConstraint();
    location4010.setX(0);
    location4010.setY(80);
    return edge;
}

From source file:de.gulden.modeling.wave.diagram.providers.WaveViewProvider.java

License:Open Source License

/**
 * @generated//from w  w w . j a v a2s  .c  om
 */
public Edge createActionToViewTransition_3005(EObject domainElement, View containerView, int index,
        boolean persisted, PreferencesHint preferencesHint) {
    Connector edge = NotationFactory.eINSTANCE.createConnector();
    edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
    RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
    ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
    points.add(new RelativeBendpoint());
    points.add(new RelativeBendpoint());
    bendpoints.setPoints(points);
    edge.setBendpoints(bendpoints);
    ViewUtil.insertChildView(containerView, edge, index, persisted);
    edge.setType(WaveVisualIDRegistry.getType(ActionToViewTransitionEditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // initializePreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
            IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
            FigureUtilities.RGBToInteger(lineRGB));
    FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
    if (edgeFontStyle != null) {
        FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
        edgeFontStyle.setFontName(fontData.getName());
        edgeFontStyle.setFontHeight(fontData.getHeight());
        edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
        edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
        org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
                IPreferenceConstants.PREF_FONT_COLOR);
        edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
    }
    Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
    if (routing != null) {
        ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
    }
    Node label4011 = createLabel(edge,
            WaveVisualIDRegistry.getType(ActionToViewTransitionConditionEditPart.VISUAL_ID));
    label4011.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location4011 = (Location) label4011.getLayoutConstraint();
    location4011.setX(0);
    location4011.setY(40);
    return edge;
}

From source file:de.gulden.modeling.wave.diagram.providers.WaveViewProvider.java

License:Open Source License

/**
 * @generated/*from  ww w  .j  av a  2 s.c om*/
 */
public Edge createModelMemberDocs_4015(View containerView, int index, boolean persisted,
        PreferencesHint preferencesHint) {
    Connector edge = NotationFactory.eINSTANCE.createConnector();
    edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
    RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
    ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
    points.add(new RelativeBendpoint());
    points.add(new RelativeBendpoint());
    bendpoints.setPoints(points);
    edge.setBendpoints(bendpoints);
    ViewUtil.insertChildView(containerView, edge, index, persisted);
    edge.setType(WaveVisualIDRegistry.getType(ModelMemberDocsEditPart.VISUAL_ID));
    edge.setElement(null);
    // initializePreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
            IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
            FigureUtilities.RGBToInteger(lineRGB));
    FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
    if (edgeFontStyle != null) {
        FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
        edgeFontStyle.setFontName(fontData.getName());
        edgeFontStyle.setFontHeight(fontData.getHeight());
        edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
        edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
        org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
                IPreferenceConstants.PREF_FONT_COLOR);
        edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
    }
    Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
    if (routing != null) {
        ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
    }
    return edge;
}

From source file:de.gulden.modeling.wave.diagram.providers.WaveViewProvider.java

License:Open Source License

/**
 * @generated//  w  ww.j  a v a 2  s  .  co m
 */
public Edge createViewTransition_4013(EObject domainElement, View containerView, int index, boolean persisted,
        PreferencesHint preferencesHint) {
    Connector edge = NotationFactory.eINSTANCE.createConnector();
    edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
    RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
    ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
    points.add(new RelativeBendpoint());
    points.add(new RelativeBendpoint());
    bendpoints.setPoints(points);
    edge.setBendpoints(bendpoints);
    ViewUtil.insertChildView(containerView, edge, index, persisted);
    edge.setType(WaveVisualIDRegistry.getType(ViewTransitionEditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // initializePreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
            IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
            FigureUtilities.RGBToInteger(lineRGB));
    FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
    if (edgeFontStyle != null) {
        FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
        edgeFontStyle.setFontName(fontData.getName());
        edgeFontStyle.setFontHeight(fontData.getHeight());
        edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
        edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
        org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
                IPreferenceConstants.PREF_FONT_COLOR);
        edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
    }
    Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
    if (routing != null) {
        ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
    }
    Node label6002 = createLabel(edge, WaveVisualIDRegistry.getType(ViewTransitionConditionEditPart.VISUAL_ID));
    label6002.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location6002 = (Location) label6002.getLayoutConstraint();
    location6002.setX(0);
    location6002.setY(40);
    return edge;
}

From source file:de.gulden.modeling.wave.diagram.providers.WaveViewProvider.java

License:Open Source License

/**
 * @generated// ww  w .j  av  a2s.c o m
 */
public Edge createDependencyRelationship_4016(EObject domainElement, View containerView, int index,
        boolean persisted, PreferencesHint preferencesHint) {
    Connector edge = NotationFactory.eINSTANCE.createConnector();
    edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
    RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
    ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
    points.add(new RelativeBendpoint());
    points.add(new RelativeBendpoint());
    bendpoints.setPoints(points);
    edge.setBendpoints(bendpoints);
    ViewUtil.insertChildView(containerView, edge, index, persisted);
    edge.setType(WaveVisualIDRegistry.getType(DependencyRelationship2EditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // initializePreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
            IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
            FigureUtilities.RGBToInteger(lineRGB));
    FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
    if (edgeFontStyle != null) {
        FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
        edgeFontStyle.setFontName(fontData.getName());
        edgeFontStyle.setFontHeight(fontData.getHeight());
        edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
        edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
        org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
                IPreferenceConstants.PREF_FONT_COLOR);
        edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
    }
    Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
    if (routing != null) {
        ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
    }
    Node label6004 = createLabel(edge,
            WaveVisualIDRegistry.getType(DependencyRelationshipStereotype2EditPart.VISUAL_ID));
    label6004.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location6004 = (Location) label6004.getLayoutConstraint();
    location6004.setX(0);
    location6004.setY(40);
    return edge;
}

From source file:de.gulden.modeling.wave.diagram.providers.WaveViewProvider.java

License:Open Source License

/**
 * @generated//from www.j a  v a 2  s. co  m
 */
public Edge createDependencyRelationship_4017(EObject domainElement, View containerView, int index,
        boolean persisted, PreferencesHint preferencesHint) {
    Connector edge = NotationFactory.eINSTANCE.createConnector();
    edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
    RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
    ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
    points.add(new RelativeBendpoint());
    points.add(new RelativeBendpoint());
    bendpoints.setPoints(points);
    edge.setBendpoints(bendpoints);
    ViewUtil.insertChildView(containerView, edge, index, persisted);
    edge.setType(WaveVisualIDRegistry.getType(DependencyRelationship3EditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // initializePreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
            IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
            FigureUtilities.RGBToInteger(lineRGB));
    FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
    if (edgeFontStyle != null) {
        FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
        edgeFontStyle.setFontName(fontData.getName());
        edgeFontStyle.setFontHeight(fontData.getHeight());
        edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
        edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
        org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
                IPreferenceConstants.PREF_FONT_COLOR);
        edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
    }
    Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
    if (routing != null) {
        ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
    }
    Node label6005 = createLabel(edge,
            WaveVisualIDRegistry.getType(DependencyRelationshipStereotype3EditPart.VISUAL_ID));
    label6005.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location6005 = (Location) label6005.getLayoutConstraint();
    location6005.setX(0);
    location6005.setY(40);
    return edge;
}

From source file:de.hentschel.visualdbc.dbcmodel.diagram.providers.DbCViewProvider.java

License:Open Source License

/**
 * @generated/*from   w  w  w.j a  v  a  2s.  co  m*/
 */
public Edge createDbcProofTarget_4001(View containerView, int index, boolean persisted,
        PreferencesHint preferencesHint) {
    Connector edge = NotationFactory.eINSTANCE.createConnector();
    edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
    RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
    ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
    points.add(new RelativeBendpoint());
    points.add(new RelativeBendpoint());
    bendpoints.setPoints(points);
    edge.setBendpoints(bendpoints);
    ViewUtil.insertChildView(containerView, edge, index, persisted);
    edge.setType(DbCVisualIDRegistry.getType(DbcProofTargetEditPart.VISUAL_ID));
    edge.setElement(null);
    // initializePreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
            IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
            FigureUtilities.RGBToInteger(lineRGB));
    FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
    if (edgeFontStyle != null) {
        FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
        edgeFontStyle.setFontName(fontData.getName());
        edgeFontStyle.setFontHeight(fontData.getHeight());
        edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
        edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
        org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
                IPreferenceConstants.PREF_FONT_COLOR);
        edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
    }
    Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
    if (routing != null) {
        ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
    }
    return edge;
}

From source file:de.hentschel.visualdbc.dbcmodel.diagram.providers.DbCViewProvider.java

License:Open Source License

/**
 * @generated//  www . j a  v a  2s .  c  o m
 */
public Edge createDbcProofReference_4002(EObject domainElement, View containerView, int index,
        boolean persisted, PreferencesHint preferencesHint) {
    Connector edge = NotationFactory.eINSTANCE.createConnector();
    edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
    RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
    ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
    points.add(new RelativeBendpoint());
    points.add(new RelativeBendpoint());
    bendpoints.setPoints(points);
    edge.setBendpoints(bendpoints);
    ViewUtil.insertChildView(containerView, edge, index, persisted);
    edge.setType(DbCVisualIDRegistry.getType(DbcProofReferenceEditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // initializePreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
            IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
            FigureUtilities.RGBToInteger(lineRGB));
    FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
    if (edgeFontStyle != null) {
        FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
        edgeFontStyle.setFontName(fontData.getName());
        edgeFontStyle.setFontHeight(fontData.getHeight());
        edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
        edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
        org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
                IPreferenceConstants.PREF_FONT_COLOR);
        edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
    }
    Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
    if (routing != null) {
        ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
    }
    Node label6001 = createLabel(edge, DbCVisualIDRegistry.getType(DbcProofReferenceKindEditPart.VISUAL_ID));
    label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location6001 = (Location) label6001.getLayoutConstraint();
    location6001.setX(0);
    location6001.setY(40);
    return edge;
}

From source file:de.hentschel.visualdbc.dbcmodel.diagram.providers.DbCViewProvider.java

License:Open Source License

/**
 * @generated/*w  w w  . j  a  v  a2  s .  c  o m*/
 */
public Edge createDbcClassExtends_4003(View containerView, int index, boolean persisted,
        PreferencesHint preferencesHint) {
    Connector edge = NotationFactory.eINSTANCE.createConnector();
    edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
    RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
    ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
    points.add(new RelativeBendpoint());
    points.add(new RelativeBendpoint());
    bendpoints.setPoints(points);
    edge.setBendpoints(bendpoints);
    ViewUtil.insertChildView(containerView, edge, index, persisted);
    edge.setType(DbCVisualIDRegistry.getType(DbcClassExtendsEditPart.VISUAL_ID));
    edge.setElement(null);
    // initializePreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
            IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
            FigureUtilities.RGBToInteger(lineRGB));
    FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
    if (edgeFontStyle != null) {
        FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
        edgeFontStyle.setFontName(fontData.getName());
        edgeFontStyle.setFontHeight(fontData.getHeight());
        edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
        edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
        org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
                IPreferenceConstants.PREF_FONT_COLOR);
        edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
    }
    Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
    if (routing != null) {
        ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
    }
    return edge;
}

From source file:de.hentschel.visualdbc.dbcmodel.diagram.providers.DbCViewProvider.java

License:Open Source License

/**
 * @generated/*  w w  w  .  j  a  va  2 s.c  o  m*/
 */
public Edge createDbcInterfaceExtends_4004(View containerView, int index, boolean persisted,
        PreferencesHint preferencesHint) {
    Connector edge = NotationFactory.eINSTANCE.createConnector();
    edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
    RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
    ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
    points.add(new RelativeBendpoint());
    points.add(new RelativeBendpoint());
    bendpoints.setPoints(points);
    edge.setBendpoints(bendpoints);
    ViewUtil.insertChildView(containerView, edge, index, persisted);
    edge.setType(DbCVisualIDRegistry.getType(DbcInterfaceExtendsEditPart.VISUAL_ID));
    edge.setElement(null);
    // initializePreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
            IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
            FigureUtilities.RGBToInteger(lineRGB));
    FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
    if (edgeFontStyle != null) {
        FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
        edgeFontStyle.setFontName(fontData.getName());
        edgeFontStyle.setFontHeight(fontData.getHeight());
        edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
        edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
        org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
                IPreferenceConstants.PREF_FONT_COLOR);
        edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
    }
    Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
    if (routing != null) {
        ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
    }
    return edge;
}