Package org.eclipse.graphiti.mm.algorithms.styles

Examples of org.eclipse.graphiti.mm.algorithms.styles.Style


     * @param diagram Parent diagram of PE
     * @return Style info
     */
    public static Style getStyleForPE(Diagram diagram) {
        final String styleId = "PE-Style";
        Style style = findStyle(diagram, styleId);

        IGaService gaService = Graphiti.getGaService();

         if (style == null) { // style not found - create new style
            style = gaService.createStyle(diagram, styleId);
            style.setForeground(gaService.manageColor(diagram,
                PE_FOREGROUND));

            style.setBackground(gaService.manageColor(diagram,
                PE_BACKGROUND));
            style.setLineWidth(2);
         }

        return style;
    }
View Full Code Here


     * @param diagram
     * @return
     */
    public static Style getStyleForPEPort(Diagram diagram) {
        final String styleId = "PEPort-Style";
        Style style = findStyle(diagram, styleId);

        IGaService gaService = Graphiti.getGaService();

         if (style == null) { // style not found - create new style
            style = gaService.createStyle(diagram, styleId);
            style.setForeground(gaService.manageColor(diagram,
                PE_PORT_FOREGROUND));

            style.setBackground(gaService.manageColor(diagram,
                PE_PORT_BACKGROUND));
            style.setLineWidth(2);
         }

        return style;
    }
View Full Code Here

     */
    public static Style getStyleForText(Diagram diagram) {
        final String styleId = "Text-Style";
        // this is a child style of PE-Style
        Style parentStyle = getStyleForPE(diagram);
        Style style = findStyle(parentStyle, styleId);

        if (style == null) { // style not found - create new style
            IGaService gaService = Graphiti.getGaService();
            style = gaService.createStyle(getStyleForPE(diagram), styleId);

            // "overwrites" values from parent style
            style.setForeground(gaService.manageColor(diagram,
                TEXT_FOREGROUND));

            style.setFont(gaService.manageFont(diagram, DEFAULT_FONT, 8,
               false, true));
        }
        return style;
    }
View Full Code Here

     * @param diagram
     * @return
     */
  public static Style getStyleForCI(Diagram diagram) {
     final String styleId = "CI-Style";
          Style style = findStyle(diagram, styleId);

          IGaService gaService = Graphiti.getGaService();

           if (style == null) { // style not found - create new style
              style = gaService.createStyle(diagram, styleId);
              style.setForeground(gaService.manageColor(diagram,
                  CI_FOREGROUND));

              style.setBackground(gaService.manageColor(diagram,
                  CI_BACKGROUND));
              style.setLineWidth(2);
           }

          return style;
  }
View Full Code Here

  /**
   * Style for literals.
   */
  public static Style getStyleForLiteral(Diagram diagram) {
    final String styleId = "Literal-Style";
        Style style = findStyle(diagram, styleId);

        IGaService gaService = Graphiti.getGaService();

         if (style == null) { // style not found - create new style
            style = gaService.createStyle(diagram, styleId);
            style.setForeground(gaService.manageColor(diagram,
                LITERAL_FOREGROUND));

            style.setBackground(gaService.manageColor(diagram,
                LITERAL_BACKGROUND));
            style.setLineWidth(2);
         }

        return style;
  }
View Full Code Here

   * @return
   */
  public static Style getStyleForConn(Diagram diagram) {
    final String styleId = "Conn-Style";

    Style style = findStyle(diagram, styleId);

    IGaService gaService = Graphiti.getGaService();

    if (style == null) { // style not found - create new style
      style = gaService.createStyle(diagram, styleId);
      style.setLineWidth(4);
      style.setForeground(gaService.manageColor(diagram,
          CONN_FOREGROUND));
    }

    return style;
  }
View Full Code Here

  public static final boolean USE_GRADIENT_BACKGROUND = false;

  public static Style getStyleForEClass(Diagram diagram) {
    final String styleId = "E-CLASS"; //$NON-NLS-1$

    Style style = findStyle(diagram, styleId);

    IGaService gaService = Graphiti.getGaService();
    if (style == null) { // style not found - create new style
      style = gaService.createStyle(diagram, styleId);
      style.setForeground(gaService.manageColor(diagram, E_CLASS_FOREGROUND));
      if (USE_GRADIENT_BACKGROUND) {
        gaService.setRenderingStyle(style, E_CLASS_GRADIENT);
      } else {
        style.setBackground(gaService.manageColor(diagram, E_CLASS_BACKGROUND));
      }
      style.setFilled(true);
      style.setLineWidth(2);
    }
    return style;
  }
View Full Code Here

  }

  public static Style getStyleForCamelClass(Diagram diagram) {
    final String styleId = "FUSE-CAMEL-NODE"; //$NON-NLS-1$

    Style style = findStyle(diagram, styleId);

    IGaService gaService = Graphiti.getGaService();
    if (style == null) { // style not found - create new style
      style = gaService.createStyle(diagram, styleId);
      style.setForeground(gaService.manageColor(diagram, E_CLASS_FOREGROUND));
      if (USE_GRADIENT_BACKGROUND) {
        gaService.setRenderingStyle(style, E_CLASS_GRADIENT);
      } else {
        style.setBackground(gaService.manageColor(diagram, E_CLASS_BACKGROUND));
      }
      style.setFilled(true);
      style.setLineWidth(2);
    }
    return style;
  }
View Full Code Here

  }

  public static Style getShadowStyleForCamelClass(Diagram diagram) {
    final String styleId = "FUSE-CAMEL-NODE-SHADOW"; //$NON-NLS-1$

    Style style = findStyle(diagram, styleId);

    IGaService gaService = Graphiti.getGaService();
    if (style == null) { // style not found - create new style
      style = gaService.createStyle(diagram, styleId);
      style.setForeground(gaService.manageColor(diagram, E_CLASS_SHADOW_FOREGROUND));
      style.setBackground(gaService.manageColor(diagram, E_CLASS_SHADOW_BACKGROUND));
      style.setFilled(true);
      style.setLineWidth(2);
    }
    return style;
  }
View Full Code Here

    final String styleId = "FUSE-CAMEL-NODE-TEXT"; //$NON-NLS-1$

    IGaService gaService = Graphiti.getGaService();

    // this is a child style of the e-class-style
    Style parentStyle = getStyleForEClass(diagram);
    Style style = null;
    if (parentStyle == null) {
      style = gaService.createStyle(diagram, styleId);
    } else {
      style = findStyle(parentStyle, styleId);
    }

    if (style == null) { // style not found - create new style
      style = gaService.createStyle(getStyleForEClass(diagram), styleId);
      // "overwrites" values from parent style
      style.setForeground(gaService.manageColor(diagram, E_CLASS_TEXT_FOREGROUND));
    }
    style.setFont(gaService.manageFont(diagram, DEFAULT_FONT, DEFAULT_FONT_SIZE, false, true));

    return style;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.graphiti.mm.algorithms.styles.Style

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.