Package java.awt

Examples of java.awt.Shape


    Color c = getDrawColor();
   
    if (c!=null) {
      g.setColor(c);
      Shape delegateShape = getDelegateShape();
      if(delegateShape!=null){
          g.draw(delegateShape);
      }
    }
View Full Code Here


  protected void fillHook(Graphics2D g) {
      Color c = getFillColor();

      if (c!=null) {
          g.setColor(c);
          Shape delegateShape = getDelegateShape();
          if (delegateShape != null){
              g.fill(delegateShape);
          }
      }
  }
View Full Code Here

            this.actionName = actionName;
        }

        public void actionPerformed(ActionEvent e) {
            // The first selected element is in charge of applying the collective action to the selection
            Shape s0 = getElementContainer().getSelection().getShape(0);
            if (s0 instanceof SelectionContextualActionProvider){
                CompoundEdit ce=new CompoundEdit();
                ((SelectionContextualActionProvider)getElementContainer().getSelection().getSelectedElements().get(0)).doCollectiveAction(getElementContainer().getSelection(), actionX, actionY, actionTarget, actionName, ce);
                ce.end();
View Full Code Here

      data=null;
    }
   
    boolean isValidDataSourceDrag(Point p){
      DiagramSelection ds=comp.getDiagramSelection();
      Shape s=null;
      int x=(int)((double)p.x/comp.getParameters().scale)-
      comp.getParameters().xmargin;
      int y=(int)((double)p.y/comp.getParameters().scale)-
      comp.getParameters().ymargin;
      if(ds.isEmpty()){
View Full Code Here

      // 1 check if a collective zoom on primary or secondary
      // axes has to be performed
      // The criterion is same variable name (but not same data source)
      HashSet collectivePlots=new HashSet();
      for (int i = 0; i < selection.getShapeCount(); i++) {
          Shape s = selection.getShape(i);
          if (s instanceof Plot && s != plot1) {
              Plot plot=(Plot)s;

              collectivePlots.add(plot);     
          }
View Full Code Here

      return;
    }
    // collective translation
    HashSet collectivePlots=new HashSet();
    for (int i = 0; i < selection.getShapeCount(); i++) {
      Shape s = selection.getShape(i);
      if (s instanceof Plot && s != plot1) {
        collectivePlots.add(s);
      }
    }
   
View Full Code Here

   * @param y Y coordinate location wrt diagram frame
   * @return a plot
   */
  protected Plot getSelectedPlot(double x, double y){
    for (int i = 0; i < selection.getShapeCount(); i++) {
      Shape s = selection.getShape(i);
      if (s instanceof Plot
          && s.contains(x,y)) {
        return (Plot)s;
      }
    }
    return null;
  }
View Full Code Here

  /* (non-Javadoc)
   * @see simtools.diagram.DiagramSelectionListener#selectionChanged(simtools.diagram.DiagramSelection)
   */
  public void selectionChanged(DiagramSelection sel) {
    for (int i = 0; i < selection.getShapeCount(); i++) {
      Shape s = selection.getShape(i);
      if (s instanceof Plot){
        return; // there is at least on plot selected
      }
    }
    // no more plot in the selection => end of mode
View Full Code Here

            this.b = b;
            this.w = width;
        }

        public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
            Shape clipping = g.getClip();
            g.setClip(x, y, width, height);
            b.paintBorder(c, g, x, y, width + w, height);
            g.setClip(clipping);
        }
View Full Code Here

            // Draw lines
            path.drawPath(g);

            // draw arrows
            if (firstArrowTransform!=null){
                Shape s = firstArrowTransform.createTransformedShape(arrow);
                g.fill(s);
                g.draw(s);
            }

            if (lastArrowTransform!=null){
                Shape s = lastArrowTransform.createTransformedShape(arrow);
                g.fill(s);
                g.draw(s);
           
        }
View Full Code Here

TOP

Related Classes of java.awt.Shape

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.