/** @generated */
  public Node createViewTable_1002(
      EObject domainElement,
      View containerView,
      int index,
      boolean persisted,
      PreferencesHint preferencesHint) {
    Node node = NotationFactory.eINSTANCE.createNode();
    node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
    node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());

    FillStyle fillStyle = NotationFactory.eINSTANCE.createFillStyle();
    Color color = ViewTableEditPart.getDeclaredBackgroundColor();
    fillStyle.setFillColor(FigureUtilities.colorToInteger(color));
    node.getStyles().add(fillStyle);
    LineStyle lineStyle = NotationFactory.eINSTANCE.createLineStyle();
    lineStyle.setLineColor(FigureUtilities.RGBToInteger(new org.eclipse.swt.graphics.RGB(0, 0, 0)));
    node.getStyles().add(lineStyle);

    node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
    node.setType(SqlmodelVisualIDRegistry.getType(ViewTableEditPart.VISUAL_ID));
    ViewUtil.insertChildView(containerView, node, index, persisted);
    node.setElement(domainElement);
    stampShortcut(containerView, node);
    // initializeFromPreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
    FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
    if (nodeFontStyle != null) {
      FontData fontData =
          PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
      nodeFontStyle.setFontName(fontData.getName());
      nodeFontStyle.setFontHeight(fontData.getHeight());
      nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
      nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
      org.eclipse.swt.graphics.RGB fontRGB =
          PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
      nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
    }
    Node label4002 =
        createLabel(node, SqlmodelVisualIDRegistry.getType(ViewTableNameEditPart.VISUAL_ID));
    createCompartment(
        node,
        SqlmodelVisualIDRegistry.getType(ViewTableViewedColumnsEditPart.VISUAL_ID),
        false,
        false,
        true,
        true);
    createCompartment(
        node,
        SqlmodelVisualIDRegistry.getType(ViewTableViewedTablesEditPart.VISUAL_ID),
        false,
        false,
        true,
        true);
    return node;
  }
Exemplo n.º 2
0
 /** @generated */
 public Node createRequirementsGroup_2007(
     EObject domainElement,
     View containerView,
     int index,
     boolean persisted,
     PreferencesHint preferencesHint) {
   Node node = NotationFactory.eINSTANCE.createNode();
   node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
   node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
   node.getStyles().add(NotationFactory.eINSTANCE.createFillStyle());
   node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
   node.setType(RdalVisualIDRegistry.getType(RequirementsGroupEditPart.VISUAL_ID));
   ViewUtil.insertChildView(containerView, node, index, persisted);
   node.setElement(domainElement);
   stampShortcut(containerView, node);
   // initializeFromPreferences
   final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
   FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
   if (nodeFontStyle != null) {
     FontData fontData =
         PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
     nodeFontStyle.setFontName(fontData.getName());
     nodeFontStyle.setFontHeight(fontData.getHeight());
     nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
     nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
     org.eclipse.swt.graphics.RGB fontRGB =
         PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
     nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
   }
   org.eclipse.swt.graphics.RGB fillRGB =
       PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR);
   ViewUtil.setStructuralFeatureValue(
       node,
       NotationPackage.eINSTANCE.getFillStyle_FillColor(),
       FigureUtilities.RGBToInteger(fillRGB));
   Node label5013 =
       createLabel(node, RdalVisualIDRegistry.getType(RequirementsGroupNameEditPart.VISUAL_ID));
   createCompartment(
       node,
       RdalVisualIDRegistry.getType(RequirementsGroupRequirementsCompartmentEditPart.VISUAL_ID),
       true,
       false,
       false,
       false);
   return node;
 }
Exemplo n.º 3
0
 /**
  * getDescriptionStyle Accessor to retrieve the description style from a Node.
  *
  * @param node Node to retrieve the description style from.
  * @return DescriptionStyle style object
  */
 protected DescriptionStyle getDescriptionStyle(Node node) {
   return (DescriptionStyle) node.getStyle(NotationPackage.eINSTANCE.getDescriptionStyle());
 }