java Programming Glossary: basicstroke
Program to create a PNG waveform for an audio file http://stackoverflow.com/questions/11017283/program-to-create-a-png-waveform-for-an-audio-file If you want to pull those out you could. import java.awt.BasicStroke import java.awt.Color import java.awt.Font import java.awt.Graphics2D.. loc seconds duration w g2.setColor pink g2.setStroke new BasicStroke 3 g2.draw new Line2D.Double loc 0 loc h INFOPAD 2 public..
How to make line animation smoother? http://stackoverflow.com/questions/13540534/how-to-make-line-animation-smoother x y 100 100 g.setColor color Graphics2D g .setStroke new BasicStroke 2 if fill Graphics2D g .fill s else Graphics2D g .draw s ..
Get mouse detection with a dynamic shape http://stackoverflow.com/questions/13795236/get-mouse-detection-with-a-dynamic-shape java.awt.Color import java.awt.Graphics2D import java.awt.BasicStroke import java.awt.RenderingHints import java.awt.event. import.. 120 Color outside new Color 255 0 0 120 g.setStroke new BasicStroke 4 for Ellipse2D shape shapes g.setColor bg g.fill shape if.. int x int mouse.getX int y int mouse.getY g.setStroke new BasicStroke 2 int s 3 g.drawLine x s y x s y g.drawLine x y s x y s l.setIcon..
Reverse Java Graphics2D scaled and rotated coordinates http://stackoverflow.com/questions/2244157/reverse-java-graphics2d-scaled-and-rotated-coordinates the transform not its final value. Example import java.awt.BasicStroke import java.awt.Color import java.awt.Component import java.awt.Dimension.. canvas.setColor Color.BLACK canvas.setStroke new BasicStroke 3.0f this.image image this.xfrm xfrm addMouseListener new MouseAdapter..
How to rotate an image gradually in Swing? http://stackoverflow.com/questions/3405799/how-to-rotate-an-image-gradually-in-swing import gui.CrossingPanel import java.awt.BasicStroke import java.awt.Color import java.awt.Dimension import java.awt.Graphics.. comp Graphics2D comp2D Graphics2D comp BasicStroke pen new BasicStroke 15.0F BasicStroke.CAP_BUTT BasicStroke.JOIN_ROUND.. Graphics2D comp2D Graphics2D comp BasicStroke pen new BasicStroke 15.0F BasicStroke.CAP_BUTT BasicStroke.JOIN_ROUND comp2D.setRenderingHint..
CubicCurve2D connecting two JInternalFrame instances http://stackoverflow.com/questions/3951383/cubiccurve2d-connecting-two-jinternalframe-instances to handle resize events too. import java.awt.BasicStroke import java.awt.Color import java.awt.Dimension import java.awt.EventQueue.. extends JDesktopPane private static final Stroke s new BasicStroke 4.0f private MyFrame one new MyFrame One 100 100 private MyFrame..
Draw a line in a JPanel with button click in Java http://stackoverflow.com/questions/5797862/draw-a-line-in-a-jpanel-with-button-click-in-java to use Key Bindings . LinePanel.java import java.awt.BasicStroke import java.awt.BorderLayout import java.awt.Color import java.awt.Dimension.. RenderingHints.VALUE_ANTIALIAS_ON g2d.setStroke new BasicStroke 8 BasicStroke.CAP_ROUND BasicStroke.JOIN_BEVEL g.drawLine p1.x.. g2d.setStroke new BasicStroke 8 BasicStroke.CAP_ROUND BasicStroke.JOIN_BEVEL g.drawLine p1.x p1.y p2.x p2.y..
Changing JPanel Graphics g color drawing line http://stackoverflow.com/questions/6105393/changing-jpanel-graphics-g-color-drawing-line STROKE_WIDTH 6f private static final Stroke STROKE new BasicStroke STROKE_WIDTH BasicStroke.CAP_ROUND BasicStroke.JOIN_ROUND private.. static final Stroke STROKE new BasicStroke STROKE_WIDTH BasicStroke.CAP_ROUND BasicStroke.JOIN_ROUND private static final Color.. STROKE new BasicStroke STROKE_WIDTH BasicStroke.CAP_ROUND BasicStroke.JOIN_ROUND private static final Color colors Color.black Color.blue..
JFreechart series tool tip above shape annotation http://stackoverflow.com/questions/6797012/jfreechart-series-tool-tip-above-shape-annotation while 30 30 is obscured by the arc. import java.awt.BasicStroke import java.awt.Color import java.awt.geom.Arc2D import java.awt.geom.Ellipse2D.. static final Color blue Color.blue private static final BasicStroke stroke new BasicStroke 2.0f private static final double PI 180d.. Color.blue private static final BasicStroke stroke new BasicStroke 2.0f private static final double PI 180d private static final..
Image/Graphic into a Shape http://stackoverflow.com/questions/7052422/image-graphic-into-a-shape g.fillRect 0 0 w h g.setClip null g.setStroke new BasicStroke 1 g.setColor Color.blue g.draw area return result public static..
How to set same scale for domain and range axes JFreeChart http://stackoverflow.com/questions/8048652/how-to-set-same-scale-for-domain-and-range-axes-jfreechart new XYShapeAnnotation new Ellipse2D.Double 1 1 2 2 new BasicStroke 1.0f BasicStroke.CAP_BUTT BasicStroke.JOIN_MITER 10.0f dash1.. new Ellipse2D.Double 1 1 2 2 new BasicStroke 1.0f BasicStroke.CAP_BUTT BasicStroke.JOIN_MITER 10.0f dash1 0.0f Color.black.. 1 1 2 2 new BasicStroke 1.0f BasicStroke.CAP_BUTT BasicStroke.JOIN_MITER 10.0f dash1 0.0f Color.black plot.addAnnotation unitCircle..
Internal padding for JTextArea with background Image http://stackoverflow.com/questions/8462414/internal-padding-for-jtextarea-with-background-image int pointerSize 7 private Insets insets null private BasicStroke stroke null private int strokePad private int pointerPad 4 RenderingHints.. this.pointerSize pointerSize this.color color stroke new BasicStroke thickness strokePad thickness 2 hints new RenderingHints RenderingHints.KEY_ANTIALIASING..
|