public class MultiLayerFillSymbol extends AbstractFillSymbol implements IFillSymbol, IMultiLayerSymbol, IMultiLayerFillSymbol
Modifier and Type | Class and Description |
---|---|
static class |
MultiLayerFillSymbol.RegisterPersistence |
static class |
MultiLayerFillSymbol.RegisterSymbol |
Modifier and Type | Field and Description |
---|---|
static String |
MULTILAYER_FILL_SYMBOL_PERSISTENCE_DEFINITION_NAME |
FILL_SYMBOL_PERSISTENCE_DEFINITION_NAME
SYMBOL_PERSISTENCE_DEFINITION_NAME
SYMBOL_NAME
PAPER, WORLD
SELECTION_COLOR
Constructor and Description |
---|
MultiLayerFillSymbol() |
Modifier and Type | Method and Description |
---|---|
void |
addLayer(ISymbol newLayer)
Stacks a new symbol to the symbol list.
|
void |
addLayer(ISymbol newLayer,
int layerIndex)
Stacks a new symbol to the symbol list.
|
Object |
clone()
Creates a copy of the object.
|
void |
draw(Graphics2D g,
AffineTransform affineTransform,
Geometry geom,
Feature feature,
Cancellable cancel)
Used when a symbol is going to be drawn.The method to do
it will depend on the derived version of the symbol.
|
void |
drawInsideRectangle(Graphics2D g,
AffineTransform scaleInstance,
Rectangle r,
PrintAttributes properties)
Useful to render the symbol inside the TOC, or inside little
rectangles.
|
int |
getFillAlpha()
Returns the transparency of the multi layer fill symbol created
|
Color |
getFillColor() |
ISymbol |
getLayer(int layerIndex)
Obtains the symbol that "contains" a layer whose index is the argument of the method.
|
int |
getLayerCount()
Returns the number of layers
|
int |
getOnePointRgb()
Returns the rgb of the symbol when it is drawn like a point.
|
ILineSymbol |
getOutline()
Obtains the ILineSymbol interface of the outline
|
void |
getPixExtentPlus(Geometry geom,
float[] distances,
ViewPort viewPort,
int dpi)
Returns the distance between the shape's bounding box and the
symbol-that-represents-this-shape's bounding box in a two-length-float
array passed as parameter.
|
ISymbol |
getSymbolForSelection()
Returns the derived version of the symbol that will be used to draw the
feature when it is selected.
|
int |
getSymbolType()
The use of this method -and its mechanism- is being valorated.
|
boolean |
isSuitableFor(Geometry geom)
True if this symbol is ok for the geometry.
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
print(Graphics2D g,
AffineTransform at,
Geometry geom,
PrintAttributes properties) |
boolean |
removeLayer(ISymbol layer)
TODO maybe push it up to ISymbol
|
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setFillColor(Color color)
Sets the color that will be used to draw the filling pattern of this symbol.
|
void |
setLayer(int index,
ISymbol layer)
Establishes a concret symbol for a layer
|
void |
setOutline(ILineSymbol outline)
Sets the color of the outline.
|
void |
setReferenceSystem(int system)
Sets the Reference System that defines how this units have to be
handled.
|
void |
setUnit(int unitIndex)
Defines the unit used to express measures.
|
void |
swapLayers(int index1,
int index2)
Changes the position of two layers in a multilayersymbol
|
double |
toCartographicSize(ViewPort viewPort,
double dpi,
Geometry geom)
Computes and sets the size (in pixels) of the cartographic element according
to the current rendering context (output dpi, map scale, map units) and the
symbol cartgraphic settings (unit, size, and unit reference system).
|
getCartographicSize, getColor, hasFill, hasOutline, setCartographicSize, setColor, setHasFill, setHasOutline
cloneForSelection, equals, getDescription, getID, getReferenceSystem, getUnit, isOneDotOrPixel, isShapeVisible, setDescription, setID, setIsShapeVisible
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasFill, hasOutline, setHasFill, setHasOutline
getCartographicSize, getReferenceSystem, getUnit, setCartographicSize
getColor, getDescription, isOneDotOrPixel, isShapeVisible, setColor, setDescription
public static final String MULTILAYER_FILL_SYMBOL_PERSISTENCE_DEFINITION_NAME
public Color getFillColor()
getFillColor
in interface IFillSymbol
getFillColor
in class AbstractFillSymbol
public int getOnePointRgb()
ISymbol
getOnePointRgb
in interface ISymbol
getOnePointRgb
in interface IFillSymbol
getOnePointRgb
in class AbstractFillSymbol
public ILineSymbol getOutline()
IFillSymbol
getOutline
in interface IFillSymbol
getOutline
in class AbstractFillSymbol
public boolean isSuitableFor(Geometry geom)
ISymbol
isSuitableFor
in interface ISymbol
isSuitableFor
in interface IFillSymbol
isSuitableFor
in class AbstractFillSymbol
public void setFillColor(Color color)
IFillSymbol
setFillColor
in interface IFillSymbol
setFillColor
in class AbstractFillSymbol
public void setOutline(ILineSymbol outline)
IFillSymbol
setOutline
in interface IFillSymbol
setOutline
in class AbstractFillSymbol
public void draw(Graphics2D g, AffineTransform affineTransform, Geometry geom, Feature feature, Cancellable cancel)
ISymbol
public void drawInsideRectangle(Graphics2D g, AffineTransform scaleInstance, Rectangle r, PrintAttributes properties) throws SymbolDrawingException
ISymbol
drawInsideRectangle
in interface ISymbol
properties
- TODOSymbolDrawingException
- TODOpublic void getPixExtentPlus(Geometry geom, float[] distances, ViewPort viewPort, int dpi)
ISymbol
Returns the distance between the shape's bounding box and the
symbol-that-represents-this-shape's bounding box in a two-length-float
array passed as parameter.
After this method returns, the float array passed will contain two values
representing the amount of pixels separating each of the X (first element)
and Y (second element) axes.
This distance maybe dependent on:
And in any other case, if the unit of the symbol is pixels or the symbol is not even an instance of CartographicSupport, the returning values are only defined by the symbol and are not calculated.
getPixExtentPlus
in interface ISymbol
getPixExtentPlus
in class AbstractFillSymbol
public ISymbol getSymbolForSelection()
ISymbol
getSymbolForSelection
in interface ISymbol
public int getSymbolType()
ISymbol
getSymbolType
in interface ISymbol
public void print(Graphics2D g, AffineTransform at, Geometry geom, PrintAttributes properties)
print
in interface IPrintable
public void setLayer(int index, ISymbol layer) throws IndexOutOfBoundsException
IMultiLayerSymbol
setLayer
in interface IMultiLayerSymbol
IndexOutOfBoundsException
public void swapLayers(int index1, int index2)
IMultiLayerSymbol
swapLayers
in interface IMultiLayerSymbol
public ISymbol getLayer(int layerIndex)
IMultiLayerSymbol
getLayer
in interface IMultiLayerSymbol
public int getLayerCount()
IMultiLayerSymbol
getLayerCount
in interface IMultiLayerSymbol
public void addLayer(ISymbol newLayer)
IMultiLayerSymbol
addLayer
in interface IMultiLayerSymbol
public void addLayer(ISymbol newLayer, int layerIndex) throws IndexOutOfBoundsException
IMultiLayerSymbol
addLayer
in interface IMultiLayerSymbol
IndexOutOfBoundsException
public boolean removeLayer(ISymbol layer)
IMultiLayerSymbol
removeLayer
in interface IMultiLayerSymbol
public void setUnit(int unitIndex)
CartographicSupport
setUnit
in interface CartographicSupport
setUnit
in class AbstractFillSymbol
public void setReferenceSystem(int system)
CartographicSupport
setReferenceSystem
in interface CartographicSupport
setReferenceSystem
in class AbstractSymbol
public int getFillAlpha()
getFillAlpha
in interface IFillSymbol
getFillAlpha
in class AbstractFillSymbol
public double toCartographicSize(ViewPort viewPort, double dpi, Geometry geom)
CartographicSupport
toCartographicSize
in interface CartographicSupport
toCartographicSize
in class AbstractFillSymbol
public Object clone() throws CloneNotSupportedException
Cloneable
clone
in class AbstractFillSymbol
CloneNotSupportedException
- if the instance of the object cannot
be cloned. As this is extending Cloneable
so
its sure it implements it, so this exception may be used for problems
on specific object instances.Object#clone()}.
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
loadFromState
in class AbstractFillSymbol
PersistenceException
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
saveToState
in class AbstractFillSymbol
PersistenceException