Package com.aparapi.internal.tool
Class InstructionViewer
- java.lang.Object
-
- com.aparapi.internal.tool.InstructionViewer
-
- All Implemented Interfaces:
Config.InstructionListener
public class InstructionViewer extends java.lang.Object implements Config.InstructionListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInstructionViewer.DoorBellstatic classInstructionViewer.Form<T extends InstructionViewer.Form.Template>classInstructionViewer.InstructionViewstatic classInstructionViewer.Optionsprivate static classInstructionViewer.Viewprivate static classInstructionViewer.XY
-
Field Summary
Fields Modifier and Type Field Description static intARROWGAP(package private) java.awt.PolygonarrowHeadInjava.awt.PolygonarrowHeadOut(package private) ClassModelclassModelInstructionViewer.Optionsconfigprivate javax.swing.JPanelcontainer(package private) Instructioncurrentstatic intCURVEBOWprivate booleandirtystatic InstructionViewer.DoorBelldoorbellprivate InstructionViewer.XYdragStartstatic intEDGEGAP(package private) Instructionfirststatic intHGAPstatic intHGAPROOTstatic intHMARGINprivate java.util.Map<Instruction,InstructionViewer.InstructionView>locationToInstructionViewMapprivate java.awt.Graphics2Doffgraphicsprivate java.awt.image.BufferedImageoffscreenprivate java.awt.Dimensionoffscreensizeprivate java.awt.StrokeoutlineStrokeprivate java.awt.ColorselectedColorprivate java.awt.StrokethickStrokeprivate java.awt.StrokethinStrokeprivate java.awt.ColorunselectedColorstatic intVGAPprivate InstructionViewer.Viewviewstatic intVMARGIN
-
Constructor Summary
Constructors Constructor Description InstructionViewer()InstructionViewer(java.awt.Color _background, java.lang.String _name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddirty()voiddraw(java.awt.Graphics _g)voiddraw(java.awt.Graphics2D _g, java.awt.Shape _rectangle)voidedge(java.awt.Graphics2D _g, java.awt.Color _color, InstructionViewer.InstructionView _branch, InstructionViewer.InstructionView _target, java.lang.String _endLabel, java.lang.String _startLabel)voidfill(java.awt.Graphics2D _g, java.awt.Color _color, java.awt.Shape _rect)voidfill(java.awt.Graphics2D _g, java.awt.Shape _rectangle)voidfillStroke(java.awt.Graphics2D _g, java.awt.Color _fillColor, java.awt.Color _strokeColor, java.awt.Stroke _stroke, java.awt.Shape _rect)(package private) doubleflatPlace(java.awt.Graphics2D _g, InstructionViewer.InstructionView _instructionView, double _x, double _y)(package private) voidflatRender(java.awt.Graphics2D _g, InstructionViewer.InstructionView _instructionView)(package private) doublefoldPlace(java.awt.Graphics2D _g, InstructionViewer.InstructionView _instructionView, double _x, double _y, boolean _dim)(package private) voidfoldRender(java.awt.Graphics2D _g, InstructionViewer.InstructionView _instructionView)java.awt.ComponentgetContainer()(package private) InstructionViewer.InstructionViewgetInstructionView(Instruction _instruction)voidline(java.awt.Graphics2D _g, double _x1, double _y1, double _x2, double _y2)voidline(java.awt.Graphics2D _g, java.awt.Stroke _stroke, double _x1, double _y1, double _x2, double _y2)static voidmain(java.lang.String[] _args)voidrender(java.awt.Graphics2D _g)booleanselect(double _x, double _y)voidshowAndTell(java.lang.String message, Instruction head, Instruction _instruction)voidstroke(java.awt.Graphics2D _g, java.awt.Stroke _stroke, java.awt.Shape _rect)voidtext(java.awt.Graphics2D _g, java.awt.Color _color, java.lang.String _text, double _x, double _y)voidtext(java.awt.Graphics2D _g, java.lang.String _text, double _x, double _y)
-
-
-
Field Detail
-
VMARGIN
public static final int VMARGIN
- See Also:
- Constant Field Values
-
HMARGIN
public static final int HMARGIN
- See Also:
- Constant Field Values
-
HGAPROOT
public static final int HGAPROOT
- See Also:
- Constant Field Values
-
HGAP
public static final int HGAP
- See Also:
- Constant Field Values
-
VGAP
public static final int VGAP
- See Also:
- Constant Field Values
-
ARROWGAP
public static final int ARROWGAP
- See Also:
- Constant Field Values
-
EDGEGAP
public static final int EDGEGAP
- See Also:
- Constant Field Values
-
CURVEBOW
public static final int CURVEBOW
- See Also:
- Constant Field Values
-
container
private final javax.swing.JPanel container
-
offscreen
private java.awt.image.BufferedImage offscreen
-
offscreensize
private java.awt.Dimension offscreensize
-
offgraphics
private java.awt.Graphics2D offgraphics
-
dirty
private boolean dirty
-
view
private final InstructionViewer.View view
-
dragStart
private InstructionViewer.XY dragStart
-
config
public InstructionViewer.Options config
-
unselectedColor
private final java.awt.Color unselectedColor
-
selectedColor
private final java.awt.Color selectedColor
-
thickStroke
private final java.awt.Stroke thickStroke
-
thinStroke
private final java.awt.Stroke thinStroke
-
outlineStroke
private final java.awt.Stroke outlineStroke
-
arrowHeadOut
public java.awt.Polygon arrowHeadOut
-
arrowHeadIn
java.awt.Polygon arrowHeadIn
-
locationToInstructionViewMap
private final java.util.Map<Instruction,InstructionViewer.InstructionView> locationToInstructionViewMap
-
classModel
ClassModel classModel
-
first
volatile Instruction first
-
current
volatile Instruction current
-
doorbell
public static InstructionViewer.DoorBell doorbell
-
-
Method Detail
-
dirty
public void dirty()
-
draw
public void draw(java.awt.Graphics _g)
-
getContainer
public java.awt.Component getContainer()
-
text
public void text(java.awt.Graphics2D _g, java.lang.String _text, double _x, double _y)
-
text
public void text(java.awt.Graphics2D _g, java.awt.Color _color, java.lang.String _text, double _x, double _y)
-
line
public void line(java.awt.Graphics2D _g, java.awt.Stroke _stroke, double _x1, double _y1, double _x2, double _y2)
-
stroke
public void stroke(java.awt.Graphics2D _g, java.awt.Stroke _stroke, java.awt.Shape _rect)
-
fill
public void fill(java.awt.Graphics2D _g, java.awt.Color _color, java.awt.Shape _rect)
-
fillStroke
public void fillStroke(java.awt.Graphics2D _g, java.awt.Color _fillColor, java.awt.Color _strokeColor, java.awt.Stroke _stroke, java.awt.Shape _rect)
-
line
public void line(java.awt.Graphics2D _g, double _x1, double _y1, double _x2, double _y2)
-
draw
public void draw(java.awt.Graphics2D _g, java.awt.Shape _rectangle)
-
fill
public void fill(java.awt.Graphics2D _g, java.awt.Shape _rectangle)
-
getInstructionView
InstructionViewer.InstructionView getInstructionView(Instruction _instruction)
-
foldPlace
double foldPlace(java.awt.Graphics2D _g, InstructionViewer.InstructionView _instructionView, double _x, double _y, boolean _dim)
-
foldRender
void foldRender(java.awt.Graphics2D _g, InstructionViewer.InstructionView _instructionView)
-
flatPlace
double flatPlace(java.awt.Graphics2D _g, InstructionViewer.InstructionView _instructionView, double _x, double _y)
-
flatRender
void flatRender(java.awt.Graphics2D _g, InstructionViewer.InstructionView _instructionView)
-
select
public boolean select(double _x, double _y)
-
render
public void render(java.awt.Graphics2D _g)
-
edge
public void edge(java.awt.Graphics2D _g, java.awt.Color _color, InstructionViewer.InstructionView _branch, InstructionViewer.InstructionView _target, java.lang.String _endLabel, java.lang.String _startLabel)
-
showAndTell
public void showAndTell(java.lang.String message, Instruction head, Instruction _instruction)- Specified by:
showAndTellin interfaceConfig.InstructionListener
-
main
public static void main(java.lang.String[] _args) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, javax.swing.UnsupportedLookAndFeelException, AparapiException- Throws:
java.lang.ClassNotFoundExceptionjava.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjavax.swing.UnsupportedLookAndFeelExceptionAparapiException
-
-