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 class
InstructionViewer.DoorBell
static class
InstructionViewer.Form<T extends InstructionViewer.Form.Template>
class
InstructionViewer.InstructionView
static class
InstructionViewer.Options
private static class
InstructionViewer.View
private static class
InstructionViewer.XY
-
Field Summary
Fields Modifier and Type Field Description static int
ARROWGAP
(package private) java.awt.Polygon
arrowHeadIn
java.awt.Polygon
arrowHeadOut
(package private) ClassModel
classModel
InstructionViewer.Options
config
private javax.swing.JPanel
container
(package private) Instruction
current
static int
CURVEBOW
private boolean
dirty
static InstructionViewer.DoorBell
doorbell
private InstructionViewer.XY
dragStart
static int
EDGEGAP
(package private) Instruction
first
static int
HGAP
static int
HGAPROOT
static int
HMARGIN
private java.util.Map<Instruction,InstructionViewer.InstructionView>
locationToInstructionViewMap
private java.awt.Graphics2D
offgraphics
private java.awt.image.BufferedImage
offscreen
private java.awt.Dimension
offscreensize
private java.awt.Stroke
outlineStroke
private java.awt.Color
selectedColor
private java.awt.Stroke
thickStroke
private java.awt.Stroke
thinStroke
private java.awt.Color
unselectedColor
static int
VGAP
private InstructionViewer.View
view
static int
VMARGIN
-
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 void
dirty()
void
draw(java.awt.Graphics _g)
void
draw(java.awt.Graphics2D _g, java.awt.Shape _rectangle)
void
edge(java.awt.Graphics2D _g, java.awt.Color _color, InstructionViewer.InstructionView _branch, InstructionViewer.InstructionView _target, java.lang.String _endLabel, java.lang.String _startLabel)
void
fill(java.awt.Graphics2D _g, java.awt.Color _color, java.awt.Shape _rect)
void
fill(java.awt.Graphics2D _g, java.awt.Shape _rectangle)
void
fillStroke(java.awt.Graphics2D _g, java.awt.Color _fillColor, java.awt.Color _strokeColor, java.awt.Stroke _stroke, java.awt.Shape _rect)
(package private) double
flatPlace(java.awt.Graphics2D _g, InstructionViewer.InstructionView _instructionView, double _x, double _y)
(package private) void
flatRender(java.awt.Graphics2D _g, InstructionViewer.InstructionView _instructionView)
(package private) double
foldPlace(java.awt.Graphics2D _g, InstructionViewer.InstructionView _instructionView, double _x, double _y, boolean _dim)
(package private) void
foldRender(java.awt.Graphics2D _g, InstructionViewer.InstructionView _instructionView)
java.awt.Component
getContainer()
(package private) InstructionViewer.InstructionView
getInstructionView(Instruction _instruction)
void
line(java.awt.Graphics2D _g, double _x1, double _y1, double _x2, double _y2)
void
line(java.awt.Graphics2D _g, java.awt.Stroke _stroke, double _x1, double _y1, double _x2, double _y2)
static void
main(java.lang.String[] _args)
void
render(java.awt.Graphics2D _g)
boolean
select(double _x, double _y)
void
showAndTell(java.lang.String message, Instruction head, Instruction _instruction)
void
stroke(java.awt.Graphics2D _g, java.awt.Stroke _stroke, java.awt.Shape _rect)
void
text(java.awt.Graphics2D _g, java.awt.Color _color, java.lang.String _text, double _x, double _y)
void
text(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:
showAndTell
in 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.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
javax.swing.UnsupportedLookAndFeelException
AparapiException
-
-