Class Print_Plan_3d
The graphics are organized as a vertical stack of horizontal lines, top
down. Each segment of such a line can show ether a 3d-block (for
symbolizing main themes) or different kinds of 2d-lines
(for counterpoints and subordinated material).
The data must be collected in advance, in one instance of this class,
which can be used either for 2d or for
3d printing, so that normally two instances cooperate to make one diagram.
The data must be entered as lists of triples of numeric x-positions,
(from, to) and integer kind.
This is done by calling addSegment(int,int,int)
.
The call to nextRow()
starts a new row.
Afterwards either
showBlocks3dModed(Graphics2D,float,Configuration)
or
invalid reference
#showLine(Graphics2D,float,Configuration,List)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Collection of configuration values for drawing.protected class
Data item realizing the graphic segments to render. -
Field Summary
FieldsModifier and TypeFieldDescriptionList of the java awt defaultPaint
objects for 2d lines, indexed by the "kind" value (currently from 0 to 4, incl.) (currently: 0 = dashed line, 1=slashes, 2=crossed out, 3=waves, 4=hori lines).static final BufferedImage
Container into which we draw and which will paint the 2ndh line type.static final BufferedImage
Container into which we draw and which will paint the 4th line type.static final BufferedImage
Deprecated.static final BufferedImage
Container into which we draw and which will paint the 1st line type.static final BufferedImage
Container into which we draw and which will paint the 3rd line type.static TexturePaint
Paint object to draw the lines of type 2static TexturePaint
Paint object to draw the lines of type 4static TexturePaint
Deprecated.static TexturePaint
Paint object to draw the lines of type 3static TexturePaint
Paint object to draw the lines of type 1protected Stack
<List<Print_Plan_3d.Triple>> The list of lists, each standing for a horizontal line in the graphics. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an empty row at the end, iff the last row is not empty.void
addSegment
(int from, int to) Deprecated.void
addSegment
(int from, int to, int kind) Add a segment with x coordinates and a kind index to the currently growing line.void
addSegmentMerging
(int from, int to, int kind) Add a segment with x coordinates and a kind index to the currently growing line, or enlarge a preceding adjacent segment of same kind.protected Stroke
dashStroke
(int width) void
dump
(PrintStream ps) /static Print_Plan_3d.Configuration
Returns the default configuration object.Return the list of java awt defaultPaint
objects for 2d lines,void
nextRow()
Declare the growing row to be finished and a new (=next lower) row to start.void
showBlocks3dModed
(Graphics2D graphics, float xfactor) Show all 3d-blocks defined in the accumulated data instack
.void
showBlocks3dModed
(Graphics2D graphics, float xfactor, Print_Plan_3d.Configuration config) Show all 3d-blocks defined in the accumulated data instack
.void
showLine2d
(Graphics2D graphics, float xfactor) Show all 2d-segments defined in the accumulated data instack
.void
showLine2d
(Graphics2D graphics, float xfactor, Print_Plan_3d.Configuration config, List<Paint> patterns) Show all 2d-lines defined in the accumulated data instack
.
-
Field Details
-
stack
The list of lists, each standing for a horizontal line in the graphics. -
image_minus
Deprecated.Container into which we draw and which will paint the 0th line type. -
image_slash
Container into which we draw and which will paint the 1st line type. -
image_cross
Container into which we draw and which will paint the 2ndh line type. -
image_wave
Container into which we draw and which will paint the 3rd line type. -
image_hori
Container into which we draw and which will paint the 4th line type. -
paint_minus
Deprecated.Paint object to draw the lines of type 0 -
paint_wave
Paint object to draw the lines of type 1 -
paint_cross
Paint object to draw the lines of type 2 -
paint_slash
Paint object to draw the lines of type 3 -
paint_hori
Paint object to draw the lines of type 4 -
DEFAULT_PATTERNS
List of the java awt defaultPaint
objects for 2d lines, indexed by the "kind" value (currently from 0 to 4, incl.) (currently: 0 = dashed line, 1=slashes, 2=crossed out, 3=waves, 4=hori lines).
-
-
Constructor Details
-
Print_Plan_3d
public Print_Plan_3d()Only constructor. Add one empty line to the stack of horizontal lines, and open the next.
-
-
Method Details
-
dump
/ -
addSegment
public void addSegment(int from, int to, int kind) Add a segment with x coordinates and a kind index to the currently growing line.ATTENTION: no further consistency checks are done with the coordinates. The caller is responsible for non-overlapping and increasing order for all segments in the same row. In the default use case, these corodinates are device coordinates ("pixels") which come from some user-world coordinates. Therefore, for convenience, the case "from == to", resulting form scaling and rounding, is allowed and silently ignored: no segment is generated.
-
addSegmentMerging
public void addSegmentMerging(int from, int to, int kind) Add a segment with x coordinates and a kind index to the currently growing line, or enlarge a preceding adjacent segment of same kind. For details seeaddSegment(int,int,int)
-
addSegment
Deprecated.Add a segment with x and y coordinate, the kind index ==0. This means a 3d-block symbolizing main theme material. -
nextRow
public void nextRow()Declare the growing row to be finished and a new (=next lower) row to start. Can also be called after the very last data to add some space to a graphic representation. -
addFinalFramingEmptyRow
public void addFinalFramingEmptyRow()Add an empty row at the end, iff the last row is not empty. This corresponds to the empty row at the beginning added by the constructor. -
showBlocks3dModed
Show all 3d-blocks defined in the accumulated data instack
. Uses the default values as defined withPrint_Plan_3d.Configuration
. -
showBlocks3dModed
public void showBlocks3dModed(Graphics2D graphics, float xfactor, Print_Plan_3d.Configuration config) Show all 3d-blocks defined in the accumulated data instack
. The blocks have the form+------------+ | |\ +------------+ | \------------\|
The are drawn completely, without any clipping. Thus the seqential order of drawing is relevant: first the rows top down, then in each row from left to right. So each later block will overprint the earliers, if necessary:+------------+ | |\ +---+-----------------+ \---| |\ +-----------------+ | \-----------------\|
This sequential order must be adhered to by the user when defining the data byaddSegment(int,int)
and is currently not tested. The "mode" entry in the triple lists determines the form of the block (0..3 or 100..103) and whether it is "incomplete" (>= 100).- Parameters:
graphics
- the target of all draw commandsxfactor
- scaling from input data to Graphic's coordinates.config
- all configuration data for rendering.
-
showLine2d
Show all 2d-segments defined in the accumulated data instack
. Use the default configuration and the list ofDEFAULT_PATTERNS
.- Parameters:
graphics
- the target of all draw commandsxfactor
- scaling from input data to Graphic's coordinates.
-
showLine2d
public void showLine2d(Graphics2D graphics, float xfactor, Print_Plan_3d.Configuration config, List<Paint> patterns) Show all 2d-lines defined in the accumulated data instack
. Use the given vonfiguration and the list of patterns. Currently there are five line types adressable by index/kind 0 to 4.- Parameters:
graphics
- the target of all draw commandsxfactor
- scaling from input data to Graphic's coordinates.patterns
- list ofPaint
objects to draw the lines.
-
dashStroke
-
getDefaultPatterns
Return the list of java awt defaultPaint
objects for 2d lines, -
getDefaultConfiguration
Returns the default configuration object.
-