|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmain.DrawingParameters
public class DrawingParameters
The DrawingParameters
class contains information about how to
draw a component on the map, independent of the component itself. It contains
ranges for specifying the color and size of the component.
Field Summary | |
---|---|
private java.lang.String |
colorDescription
|
private DisplayRanges |
colorRanges
|
private static int |
COLORRANGES
|
private static int |
NULL
|
private java.lang.String |
sizeDescription
|
private DisplayRanges |
sizeRanges
|
private static int |
SIZERANGES
|
Constructor Summary | |
---|---|
DrawingParameters(java.lang.String rawParams)
Creates a new instance of DrawingParameters , initialized
with drawing parameters from an unparsed string from an external input
file. |
Method Summary | |
---|---|
boolean |
componentExists(MapComponent component)
Returns true if the component should be drawn,
false otherwise. |
java.awt.Color |
determineColor(MapComponent component)
Returns the color that the map component should be drawn. |
int |
determineSize(MapComponent component)
Returns the size that the map component should be drawn. |
java.lang.String |
getColorDescription()
Gets the String containing the color ranges description. |
DisplayRanges |
getColorRanges()
Gets the DisplayRanges containing the color ranges
associated with the map component. |
java.lang.String |
getSizeDescription()
Gets the String containing the size ranges description. |
DisplayRanges |
getSizeRanges()
Gets the DisplayRanges containing the size ranges
associated with the map component. |
private void |
parseLine(int property,
java.lang.String line)
|
private boolean |
parseSpecialCommand(int property,
java.lang.String line)
|
void |
setColorDescription(java.lang.String colorDescription)
|
void |
setColorRanges(DisplayRanges colorRanges)
|
void |
setSizeDescription(java.lang.String sizeDescription)
|
void |
setSizeRanges(DisplayRanges sizeRanges)
|
java.lang.String |
toString()
Returns a string representation of this DrawingParameters . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final int NULL
private static final int COLORRANGES
private static final int SIZERANGES
private DisplayRanges colorRanges
private DisplayRanges sizeRanges
private java.lang.String colorDescription
private java.lang.String sizeDescription
Constructor Detail |
---|
public DrawingParameters(java.lang.String rawParams) throws java.text.ParseException
DrawingParameters
, initialized
with drawing parameters from an unparsed string from an external input
file.
rawParams
- a String
of unparsed data from an input file
java.text.ParseException
- if there is a problem parsing the input fileMethod Detail |
---|
private void parseLine(int property, java.lang.String line) throws java.text.ParseException
java.text.ParseException
private boolean parseSpecialCommand(int property, java.lang.String line) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public boolean componentExists(MapComponent component)
true
if the component should be drawn,
false
otherwise.
component
- - a MapComponent
public java.awt.Color determineColor(MapComponent component)
component
- a MapComponent
public int determineSize(MapComponent component)
component
- a MapComponent
public DisplayRanges getColorRanges()
DisplayRanges
containing the color ranges
associated with the map component. The client and use it to add and
remove ranges using its methods.
public DisplayRanges getSizeRanges()
DisplayRanges
containing the size ranges
associated with the map component. The client and use it to add and
remove ranges using its methods.
public java.lang.String getColorDescription()
String
containing the color ranges description.
public java.lang.String getSizeDescription()
String
containing the size ranges description.
public java.lang.String toString()
DrawingParameters
.
The string's format is in a valid input file format.
toString
in class java.lang.Object
DrawingParameters
public void setColorRanges(DisplayRanges colorRanges)
public void setSizeRanges(DisplayRanges sizeRanges)
public void setColorDescription(java.lang.String colorDescription)
public void setSizeDescription(java.lang.String sizeDescription)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |