Demos and Usage of java.awt.BasicStroke.getLineWidth()


   1: 
   2: import java.awt.BasicStroke;
   3: import java.awt.Component;
   4:         ...
   5:     private Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
   6:     private BasicStroke stroke;
   7:     private GeneralPath path;
   8:         ...
   9: 
  10:     protected abstract BasicStroke getStroke (Object value);
  11: 
  12:         ...
  13:         path.reset();
  14:         path.moveTo(x + stroke.getLineWidth() / 2, y);

View Full Code Here
   1: import java.awt.Graphics2D;
   2: import java.awt.BasicStroke;
   3: 
   4:         ...
   5: 
   6:         BasicStroke s = view.getModel().getScaleManager().getStrokeCircle();
   7:         if ((t == CommLFEventPackager.E_SK_O) ||
   8:         ...
   9:         g2.setColor(border_color);
  10:         g2.draw(new Ellipse2D.Float((int)((s.getLineWidth() + getWidth() - (circle_diam * scale)) / 2), (int)(text_dimension.height + (vspace_between * scale) + (s.getLineWidth() / 2)), (int)(circle_diam * scale) - (int)(s.getLineWidth()), (int)(circle_diam * scale) - (int)(s.getLineWidth())));
  11:     }

View Full Code Here
   1: 
   2: import java.awt.BasicStroke;
   3: import java.awt.Stroke;
   4:         ...
   5:       case STROKE_DASHED:
   6:         return new BasicStroke(width, BasicStroke.CAP_SQUARE,
   7:         ...
   8:                 BasicStroke.JOIN_MITER,
   9:                 10.0f, new float[]
  10:         ...
  11:       BasicStroke bs = (BasicStroke) s;
  12:       return bs.getLineWidth();

View Full Code Here
   1:     private Color strokeColor = Color.black;
   2:     private BasicStroke stroke = new BasicStroke( 1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 10.0f);;
   3:     
   4:         ...
   5:     
   6:     BasicStroke getStroke() {
   7:         return stroke;
   8:         ...
   9:                       float dashes[] = Utility.getFloats(styleData);
  10:                       stroke = new BasicStroke( stroke.getLineWidth(), stroke.getEndCap(), stroke.getLineJoin(), stroke.getMiterLimit(), dashes, 1.0f);                      
  11:                       

View Full Code Here
   1:   public TVector() {
   2:     setStroke(new BasicStroke(1));
   3:   }
   4:         ...
   5:     tip.setXY(xt + xc, yt + yc);
   6:     setStroke(new BasicStroke(1));
   7:   }
   8:         ...
   9: 
  10:   public void setStroke(BasicStroke stroke) {
  11:     if (stroke == null) return;
  12:         ...
  13:     this.stroke = new BasicStroke(stroke.getLineWidth(),

View Full Code Here
   1: import java.awt.*;
   2: import java.awt.BasicStroke;
   3: import java.awt.Color;
   4:         ...
   5:     private Color lineColor = new Color(0, 0, 0, 255);
   6:     private BasicStroke lineStroke;
   7:         ...
   8:     private Stroke fillStroke = new BasicStroke(1);
   9:     private boolean enabled = true;
  10:         ...
  11:         this.linePattern = linePattern;
  12:         lineStroke = createLineStroke(lineStroke.getLineWidth());

View Full Code Here
   1: 
   2: import java.awt.BasicStroke;
   3: import java.awt.Color;
   4:         ...
   5:       {
   6:         stroke = new BasicStroke(1);
   7:       }
   8:         ...
   9:   {
  10:     if (s instanceof BasicStroke == false)
  11:     {
  12:         ...
  13:     BasicStroke bs = (BasicStroke) s;
  14:     return bs.getLineWidth() > 0;

View Full Code Here
   1:   protected AffineTransform transform = new AffineTransform();
   2:   protected BasicStroke stroke = new BasicStroke();
   3:   protected Color color = Color.black;
   4:         ...
   5: 
   6:   public void setStroke(BasicStroke stroke) {
   7:     if (stroke == null) return;
   8:         ...
   9:     this.stroke = new BasicStroke(stroke.getLineWidth(),
  10:                                   BasicStroke.CAP_BUTT,
  11:         ...
  12:                                   stroke.getDashPhase());
  13:     defaultWidth = stroke.getLineWidth();

View Full Code Here
   1: import java.awt.AlphaComposite;
   2: import java.awt.BasicStroke;
   3: import java.awt.Canvas;
   4:         ...
   5:                                     RenderingHints.KEY_ANTIALIASING) == RenderingHints.VALUE_ANTIALIAS_ON) {
   6:                             if (stroke instanceof BasicStroke) {
   7:         ...
   8:                                 BasicStroke bs = (BasicStroke) stroke;
   9:         ...
  10:                                 stroke = new BasicStroke(bs.getLineWidth()

View Full Code Here
   1: 
   2:     static public final Stroke      DEFAULT_STROKE = new BasicStroke((float)DEFAULT_PEN_WIDTH, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);
   3: 
   4:         ...
   5: 
   6:     protected transient BasicStroke stroke = (BasicStroke) DEFAULT_STROKE;
   7: 
   8:         ...
   9:         newBasicVisualComponent.fillPaint = fillPaint;
  10:         newBasicVisualComponent.stroke = new BasicStroke(stroke.getLineWidth(),
  11:                                                          stroke.getEndCap(),
  12:         ...
  13:             Vector strokeVector = new Vector();
  14:             strokeVector.addElement(new Float(stroke.getLineWidth()));

View Full Code Here
   1: 
   2: import java.awt.BasicStroke;
   3: import java.awt.Color;
   4:         ...
   5:         Stroke currentStroke = g.getStroke();
   6:         if (currentStroke instanceof BasicStroke) {
   7:         ...
   8:             BasicStroke bstroke = (BasicStroke) currentStroke;
   9:             if (bstroke.getDashArray() != null) {
  10:         ...
  11:                 g.setStroke(new BasicStroke(bstroke.getLineWidth(), bstroke

View Full Code Here
   1: 
   2: import java.awt.BasicStroke;
   3: import java.awt.Color;
   4:         ...
   5:             context.getGraphics().setColor(Color.BLACK);
   6:             context.getGraphics().setStroke(new BasicStroke(0.5f));
   7:             Point current = getModel().getStart();
   8:         ...
   9:         }
  10:         BasicStroke stroke = createStroke(scale, "lineWidth");
  11:         context.getGraphics().setStroke(stroke);
  12:         ...
  13:                     .setColor(
  14:                             stroke.getLineWidth() > 10 ? IViewElement.SELECTED_COLOR_TRANSPARENT

View Full Code Here
   1: 
   2:   private BasicStroke    currentStroke = new BasicStroke();
   3:   private AlphaComposite currentComposite = null;
   4:         ...
   5: 
   6:       if( currentStroke.getLineWidth() != 1.0f )
   7:         ...
   8:         buff.append("stroke-width:" + flstr(currentStroke.getLineWidth()) + "; ");
   9:       
  10:         ...
  11:       if( currentStroke.getEndCap() != BasicStroke.CAP_BUTT ) { 

View Full Code Here