Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Path


    if (this.isLinePass(pass)) {
      if (item == 0) {
        if (this.drawSeriesLineAsPath) {
          final State s = (State) state;
          s.lastPointGood = false;
          s.seriesPath = new Path(gc.getDevice());
        }
      }

      if (this.getItemLineVisible(series, item)) {
        this.drawPrimaryLineAsPath(state, gc, plot, dataset, pass,
View Full Code Here


    }

    final State s = (State) this.initialise(gc, dataArea, plot, dataset,
        info);

    s.seriesPath = new Path(gc.getDevice());

    final RectangleEdge xAxisLocation = plot.getDomainAxisEdge();
    final RectangleEdge yAxisLocation = plot.getRangeAxisEdge();

    for (final Iterator iter = items.iterator(); iter.hasNext();) {
View Full Code Here

   * @return The array of shapes.
   */
  private void createStandardSeriesShapes() {
    // Path[] result = new Path[10];
    final List paths = new LinkedList();
    Path path;

    final float size = 6.0f;
    final float delta = size / 2.0f;

    // square
    // result[0] = new Rectangle2D.Double(-delta, -delta, size, size);
    path = new Path(this.device);
    path.addRectangle(-delta, -delta, size, size);
    paths.add(path);

    // circle
    path = new Path(this.device);
    path.addArc(0, 0, size, size, 0, 360);
    paths.add(path);

    // up-pointing triangle
    // xpoints = intArray(0.0, delta, -delta);
    // ypoints = intArray(-delta, delta, delta);
View Full Code Here

    this.shapeSequence = (Path[]) paths.toArray(new Path[paths.size()]);
  }

  public void dispose() {
    for (int i = 0; i < this.shapeSequence.length; i++) {
      final Path path = this.shapeSequence[i];
      path.dispose();
    }
    for (int a = 0; a < this.paintSequence.length; a++) {
      this.paintSequence[a].dispose();
    }
  }
View Full Code Here

   * Returns the next shape in the sequence.
   *
   * @return The shape.
   */
  public Path getNextShape() {
    final Path result = this.shapeSequence[this.shapeIndex
        % this.shapeSequence.length];
    this.shapeIndex++;
    return result;
  }
View Full Code Here

      // Erst alle Pfade malen
      for (final MapObject mo : obj) {
        final List<MapNodeRef> nodes = mo.getNodes();
        boolean first = true;
        final String wayName = mo.getName();
        final Path path = new Path(display);
        for (final MapNodeRef node : nodes) {
          final Angle lat = node.getNode().getLatitude();
          final Angle lon = node.getNode().getLongitude();
          final int x = (int) ((lon.getVal() - cm.getLon()) / cm.getLonInc());
          final int y = (int) ((cm.getLat() - lat.getVal()) / cm.getLatInc());
          if (first)
            path.moveTo(x, y);
          else
            path.lineTo(x, y);
          first = false;
        }
        gc.setForeground(black);
        gc.setLineWidth(5);
        gc.drawPath(path);
View Full Code Here

          Pattern pattern = new Pattern(null, 0, glossy.y, 0, glossy.y
              + glossy.height, themeRender.getMenu_control_item_bg_color1(),
              themeRender.getMenu_control_item_bg_color1_alpha(), themeRender
                  .getMenu_control_item_bg_color2(), themeRender
                  .getMenu_control_item_bg_color2_alpha());
          Path path = new Path(null);
          path.addRectangle(glossy.x, glossy.y, glossy.width, glossy.height);
          g.setBackgroundPattern(pattern);
          g.fillPath(path);
          path.dispose();

          // draw border
          path = GraphicsUtil.createRoundRectangle(outerBorder, 2);
          g.setForeground(themeRender.getMenu_control_item_outer_border());
          g.drawPath(path);
          path.dispose();

          pattern = new Pattern(null, 0, glossy.y, 0, glossy.y + glossy.height,
              themeRender.getMenu_control_item_bg_glossy_track1(), themeRender
                  .getMenu_control_item_bg_glossy_track1_alpha(),
              themeRender.getMenu_control_item_bg_glossy_track2(), themeRender
                  .getMenu_control_item_bg_glossy_track2_alpha());

          path = GraphicsUtil.createTopRoundRectangle(glossy, 2);
          g.setBackgroundPattern(pattern);
          g.fillPath(path);
          path.dispose();

          Color innerBorderColor = themeRender.getMenu_control_item_inner_border();

          path = GraphicsUtil.createRoundRectangle(innerBorder, 2);
          g.setForeground(innerBorderColor);
          g.drawPath(path);
          path.dispose();

          path = GraphicsUtil.createRoundRectangle(glow, 2);
          g.setClipping(path);
          path.dispose();

          Color glowColor = themeRender.getMenu_control_item_bg_glow();

          path = createBottomRadialPath(glow);
          float[] point = new float[2];
          float[] bounds = new float[4];
          path.getBounds(bounds);
          point[0] = (bounds[0] + bounds[0] + bounds[2]) / 2f;
          point[1] = (bounds[1] + bounds[1] + bounds[3]) / 2f;
          GCExtension extension = new GCExtension(g);
          extension.fillGradientPath(path, point, glowColor, 255,
              new Color[] { glowColor }, new int[] { 0 });
          path.dispose();

          g.setClipping((Path) null);
          g.setAdvanced(false);
        }
      }
View Full Code Here

  {
    if (GraphicsUtil.checkGdip())
    {
      g.setAdvanced(true);
      Rectangle backRect = new Rectangle(rect.x, rect.y, rect.width, rect.height);
      Path path = GraphicsUtil.createRoundPath(backRect, 1.2f);
      g.setForeground(colors[8]);
      g.drawPath(path);
      path.dispose();
      g.setAdvanced(false);
    }
    else
    {
      g.setForeground(colors[8]);
View Full Code Here

  private void drawGradientBorder(GC g, Rectangle rect, Color[] colors) {
    if (GraphicsUtil.checkGdip()) {
      g.setAdvanced(true);
      Rectangle backRect = new Rectangle(rect.x, rect.y, rect.width, rect.height);
      Path path = GraphicsUtil.createRoundPath(backRect, 2.0f);//1.2f
      g.setForeground(colors[8]);
      g.drawPath(path);
      path.dispose();
      g.setAdvanced(false);
    } else {
      g.setForeground(colors[8]);
      g.drawRectangle(rect);
    }
View Full Code Here

    Pattern pattern = new Pattern(null, 0, glossy.y, 0, glossy.y + glossy.height,
        themeRender.getTool_item_bg_color1(), themeRender
        .getTool_item_bg_color1_alpha(), themeRender.getTool_item_bg_color2(),
        themeRender.getTool_item_bg_color2_alpha());
    Path path = new Path(null);
    path.addRectangle(glossy.x, glossy.y, glossy.width, glossy.height);
    gc.setBackgroundPattern(pattern);
    gc.fillPath(path);
    path.dispose();

    // draw border
    path = GraphicsUtil.createRoundRectangle(outerBorder, 2);
    gc.setForeground(themeRender.getTool_item_outer_border());
    gc.drawPath(path);
    path.dispose();

    if (selected && (menuTracked || (getMenu() != null && !canSelected())))   {
      path = GraphicsUtil.createTopRoundRectangle(innerBorder, 2);
      gc.setBackground(themeRender.getTool_item_bg_glossy_showMenu());
      gc.fillPath(path);
      path.dispose();

      path = GraphicsUtil.createTopRoundRectangle(innerBorder, 2);
      gc.setForeground(themeRender.getTool_item_bg_glossy_showMenu());
      gc.drawPath(path);
      path.dispose();
      gc.setAdvanced(false);
      return;
    } else if (selected && getMenu() != null) {
      pattern = new Pattern(null, 0, glossy.y, 0, glossy.y + glossy.height, themeRender
          .getTool_item_bg_glossy_selected1(), themeRender
          .getTool_item_bg_glossy_selected1_alpha(), themeRender
          .getTool_item_bg_glossy_selected2(), themeRender
          .getTool_item_bg_glossy_selected2_alpha());
      Rectangle nonMenuRect = getNonMenuRect();
      Rectangle nonMenuGlossy = new Rectangle(innerBorder.x, innerBorder.y,
          nonMenuRect.width - 1, innerBorder.height / 2);
      path = createTopLeftRoundRectangle(nonMenuGlossy, 2);
      gc.setBackgroundPattern(pattern);
      gc.fillPath(path);
      path.dispose();

      pattern = new Pattern(null, 0, glossy.y, 0, glossy.y + glossy.height, themeRender
          .getTool_item_bg_glossy_track1(), themeRender
          .getTool_item_bg_glossy_track1_alpha(), themeRender
          .getTool_item_bg_glossy_track2(), themeRender
          .getTool_item_bg_glossy_track2_alpha());

      Rectangle menuRect = getMenuRect();
      Rectangle menuGlossy = new Rectangle(menuRect.x, innerBorder.y,
          menuRect.width - 1, innerBorder.height / 2);
      path = createTopRightRoundRectangle(menuGlossy, 2);
      gc.setBackgroundPattern(pattern);
      gc.fillPath(path);
      path.dispose();

      Color innerBorderColor = themeRender.getTool_item_inner_border_selected();

      path = createLeftRoundPath(new Rectangle(innerBorder.x, innerBorder.y,
          nonMenuRect.width - 1, innerBorder.height), 2);
      gc.setForeground(innerBorderColor);
      gc.drawPath(path);
      path.dispose();

      innerBorderColor = themeRender.getTool_item_inner_border_track();

      path = createRightRoundPath(new Rectangle(menuRect.x, innerBorder.y,
          menuRect.width, innerBorder.height), 2);
      gc.setForeground(innerBorderColor);
      gc.drawPath(path);
      path.dispose();

      path = GraphicsUtil.createRoundRectangle(glow, 2);
      gc.setClipping(path);
      path.dispose();

      Color glowColor = themeRender.getTool_item_bg_glow_track();
      path = createBottomRadialPath(glow);
      float[] point = new float[2];
      float[] bounds = new float[4];
      path.getBounds(bounds);
      point[0] = (bounds[0] + bounds[0] + bounds[2]) / 2f;
      point[1] = (bounds[1] + bounds[1] + bounds[3]) / 2f;
      GCExtension extension = new GCExtension(gc);
      extension.fillGradientPath(path, point, glowColor, 255, new Color[] { glowColor },
          new int[] { 0 });
      path.dispose();
      gc.setClipping((Region) null);

      gc.setAdvanced(false);
      return;
    }

    if (!(selected)) pattern = new Pattern(null, 0, glossy.y, 0, glossy.y + glossy.height,
        themeRender.getTool_item_bg_glossy_track1(), themeRender
        .getTool_item_bg_glossy_track1_alpha(), themeRender
        .getTool_item_bg_glossy_track2(), themeRender
        .getTool_item_bg_glossy_track2_alpha());
    else
      pattern = new Pattern(null, 0, glossy.y, 0, glossy.y + glossy.height, themeRender
          .getTool_item_bg_glossy_selected1(), themeRender
          .getTool_item_bg_glossy_selected1_alpha(), themeRender
          .getTool_item_bg_glossy_selected2(), themeRender
          .getTool_item_bg_glossy_selected2_alpha());
    path = GraphicsUtil.createTopRoundRectangle(glossy, 2);
    gc.setBackgroundPattern(pattern);
    gc.fillPath(path);
    path.dispose();

    Color innerBorderColor = (selected)
    || ((getStyle() & SWT.TOGGLE) != 0 && getSelection()) ? themeRender
        .getTool_item_inner_border_selected() : themeRender
        .getTool_item_inner_border_track();

        path = GraphicsUtil.createRoundRectangle(innerBorder, 2);
        gc.setForeground(innerBorderColor);
        gc.drawPath(path);
        path.dispose();

        if (!((menuTracked || (getMenu() != null && !canSelected())) && selected)) {
          path = GraphicsUtil.createRoundRectangle(glow, 2);
          gc.setClipping(path);
          path.dispose();

          Color glowColor = themeRender.getTool_item_bg_glow_track();

          if ((getStyle() & SWT.TOGGLE) != 0 && getSelection()) {
            glowColor = themeRender.getTool_item_bg_checked_glow_track();
          }

          path = createBottomRadialPath(glow);
          float[] point = new float[2];
          float[] bounds = new float[4];
          path.getBounds(bounds);
          point[0] = (bounds[0] + bounds[0] + bounds[2]) / 2f;
          point[1] = (bounds[1] + bounds[1] + bounds[3]) / 2f;
          GCExtension extension = new GCExtension(gc);
          extension.fillGradientPath(path, point, glowColor, 255, new Color[] { glowColor },
              new int[] { 0 });
          path.dispose();
          gc.setClipping((Region) null);
        }
        gc.setAdvanced(false);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.graphics.Path

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.