public static class IltBTSAntennaBaseRenderer.Offscreen extends IltBTSAntennaBaseRenderer
getRect
and boundingBox
, which yields to
better use of hard-to-compute Shape
s.
As the use of offscreen buffered image is not always supported (such as
with blinking colors or when the antenna bounding box is too big), this
renderer should also be able to render the BTS antenna directly into the
main Graphics
.
Internal use only.
IltBTSAntennaBaseRenderer.Offscreen, IltBTSAntennaBaseRenderer.Standard
DRAWING_THRESHOLD
Constructor and Description |
---|
Offscreen() |
Modifier and Type | Method and Description |
---|---|
IlvRect |
boundingBox(IlvTransformer transf,
IlvRect rect,
boolean withSelection)
Returns the bounding box of the area that
draw(g,t,rect) draws into. |
protected boolean |
containsExtraBorders(IlvPoint p,
IlvPoint tp,
IlvTransformer t,
IlvRect rect)
Tests whether a point lies within the borders of this object.
|
protected boolean |
containsMain(IlvPoint p,
IlvPoint tp,
IlvTransformer t,
IlvRect rect)
Tests whether a point lies within the main part of the base of this object.
|
protected ilog.tgo.graphic.renderer.internal.IltBaseRendererState |
createBaseRendererState()
Creates the BTS base renderer state.
|
void |
draw(Graphics grp,
IlvTransformer transf,
IlvRect rect)
Draws the entire base, such that it fits into a given rectangle.
|
protected boolean |
drawAlarmBorder(Graphics grp,
IlvTransformer transf,
IlvRect rect,
int distance)
Draw the alarm border.
|
protected void |
drawExtraBorder(Graphics grp,
IlvTransformer transf,
IlvRect rect,
IltPalette palette,
int distance,
int thickness)
Draws an extra border inside or outside the base depending
on the value returned by
isExtraBorderOutside() . |
protected void |
drawExtraBorder(Graphics grp,
Shape shape,
IltPalette palette)
Draws the extra border for a given border
Shape . |
void |
drawMain(Graphics grp,
IlvTransformer transf,
IlvRect rect)
Draws the main part of the base.
|
protected boolean |
drawSelectionBorder(Graphics grp,
IlvTransformer transf,
IlvRect rect,
int distance)
Draw the selection border.
|
float |
getAlphaBeamWidth()
Returns the alpha value used to achieve transparency effects when
drawing the antenna beam width.
|
int |
getAntennaRadius()
Returns the antenna size when the power value is maximum.
|
float |
getBeam()
Returns the beam of the antenna.
|
int |
getBeamDirection()
Returns the direction of the antenna, in degrees.
|
int |
getBeamWidth()
Returns the beam width of the antenna, in degrees.
|
int |
getBeamWidthRadius()
Returns the antenna beam width radius when the power value
is maximum.
|
float |
getPower()
Returns the power of the antenna.
|
int |
getPowerMaxValue()
Returns the maximum power possible value for the antenna.
|
IlvRect |
getRect(IlvPoint center)
Returns the preferred size of the base.
|
int |
getRotation()
Returns the antenna orientation, which is measured in degrees.
|
Shape |
getShape(IlvTransformer transf)
Returns the cached bounding shape of this element.
|
protected void |
initBaseRenderer()
Initializes the properties of this base renderer.
|
void |
initResources()
Initializes resources using the property values defined in
this base renderer.
|
boolean |
isAntennaVisible()
Returns if the antenna is visible or not.
|
boolean |
isAntialiasing()
Returns if anti-aliasing is used or not when drawing the
antenna.
|
boolean |
isBeamWidthBorderVisible()
Returns if the bean width is drawn with a border or not.
|
boolean |
isBeamWidthVisible()
Returns if the antenna beamwidth is visible or not.
|
void |
setAlarmBorderColor(Color c)
Sets the color of the alarm border, or
null if no alarm
border is to be drawn. |
void |
setAlphaBeamWidth(float v)
Sets the alpha value used to achieve transparency effects when
drawing the antenna beam width.
|
void |
setAntennaRadius(int r)
Sets the antenna size when the power value is maximum.
|
void |
setAntennaVisible(boolean v)
Sets if the antenna is visible or not.
|
void |
setAntialiasing(boolean antialiasing)
Sets if the anti-aliasing is used or not when drawing the
antenna.
|
void |
setBackground(Color bg)
Sets the background color used to display the face part.
|
void |
setBeam(float v)
Sets the beam of the antenna.
|
void |
setBeamDirection(int v)
Sets the direction of the antenna, in degrees.
|
void |
setBeamWidth(int w)
Sets the beam width of the antenna, in degrees.
|
void |
setBeamWidthBorderVisible(boolean v)
Sets if the bean width is drawn with a border or not.
|
void |
setBeamWidthRadius(int v)
Sets the antenna beam width radius when the power value
is maximum.
|
void |
setBeamWidthVisible(boolean v)
Sets if the antenna beamwidth is visible or not.
|
void |
setBorderColor(Color c)
Sets the primary color of the base border.
|
void |
setBorderColor2(Color c)
Sets the secondary color of the base border.
|
void |
setDottedBorderBackground(Color c)
Sets the background color of the dotted border, or
null if no dotted border is to be drawn. |
void |
setDottedBorderForeground(Color c)
Sets the foreground color of the dotted border, or
null if no dotted border is to be drawn. |
void |
setForeground(Color fg)
Sets the foreground color used to display the face part.
|
void |
setPower(float v)
Sets the power of the antenna.
|
void |
setPowerMaxValue(int v)
Sets the maximum power possible value for the antenna.
|
void |
setRotation(int r)
Sets the antenna orientation, which is measured in degrees.
|
void |
setSelectionBorderBackground(Color v)
Sets the background color of the selection border, or
null if no
selection border is to be drawn. |
void |
setSelectionBorderForeground(Color c)
Sets the foreground color of the selection border, or
null if no
selection border is to be drawn. |
drawExtraBorders, isExtraBorderOutside
__isDottedBorderVisible, attach, boundingBoxWithTransformer, contains, drawExtraBorder, dropResources, getAlarmBorderColor, getAlarmBorderWidth, getAlarmColorLevel, getBackground, getBaseRenderer, getBaseRendererState, getBorderColor, getBorderColor2, getBorderLineStyle, getBorderPalette, getBorderPattern, getBorderWidth, getBrightPalette, getDarkPalette, getDeprecatedBlinkingMode, getDetailLevel, getDottedBorderBackground, getDottedBorderForeground, getDottedBorderLineStyle, getDottedBorderPalette, getExtraBorders, getFillAngle, getFillEnd, getFillStart, getFillStyle, getFillTexture, getForeground, getPalette, getPattern, getRepresentationObject, getSelectionBorderBackground, getSelectionBorderForeground, getSelectionBorderLineStyle, getSelectionBorderWidth, getSourceImage, getView, isAlarmBorderVisible, isAlarmColorVisible, isBaseSelectionBorderVisible, isDottedBorderVisible, isPolygonalBorder, isReliefBorders, isUsingBlinkingResources, setAlarmBorderVisible, setAlarmBorderWidth, setAlarmColorLevel, setAlarmColorVisible, setBaseRendererState, setBaseSelectionBorderVisible, setBorderLineStyle, setBorderPattern, setBorderWidth, setDeprecatedBlinkingMode, setDetailLevel, setDottedBorderLineStyle, setDottedBorderVisible, setFillAngle, setFillEnd, setFillStart, setFillStyle, setFillTexture, setPattern, setPolygonalBorder, setReliefBorders, setRepresentationObject, setSelectionBorderLineStyle, setSelectionBorderWidth, setSourceImage, setView
protected void initBaseRenderer()
IltBaseRenderer
initBaseRenderer
in class IltBaseRenderer
protected ilog.tgo.graphic.renderer.internal.IltBaseRendererState createBaseRendererState()
createBaseRendererState
in class IltBaseRenderer
public void setForeground(Color fg)
IltBaseRenderer
setForeground
in class IltBaseRenderer
fg
- Foreground colorpublic void setBackground(Color bg)
IltBaseRenderer
setBackground
in class IltBaseRenderer
bg
- background colorpublic void setBorderColor(Color c)
IltBaseRenderer
The value depends on the semantic state of the object.
setBorderColor
in class IltBaseRenderer
public void setBorderColor2(Color c)
IltBaseRenderer
The value depends on the semantic state of the object.
setBorderColor2
in class IltBaseRenderer
public void setAlarmBorderColor(Color c)
IltBaseRenderer
null
if no alarm
border is to be drawn.
The value depends on the semantic state of the object.
setAlarmBorderColor
in class IltBaseRenderer
public void setSelectionBorderForeground(Color c)
IltBaseRenderer
null
if no
selection border is to be drawn.
The value depends on the graphic object environment.
setSelectionBorderForeground
in class IltBaseRenderer
public void setSelectionBorderBackground(Color v)
IltBaseRenderer
null
if no
selection border is to be drawn.
The value depends on the graphic object environment.
setSelectionBorderBackground
in class IltBaseRenderer
public void setDottedBorderForeground(Color c)
IltBaseRenderer
null
if no dotted border is to be drawn.
The value depends on the graphic object environment.
setDottedBorderForeground
in class IltBaseRenderer
public void setDottedBorderBackground(Color c)
IltBaseRenderer
null
if no dotted border is to be drawn.
The value depends on the graphic object environment.
setDottedBorderBackground
in class IltBaseRenderer
public void setRotation(int r)
setRotation
in class IltBTSAntennaBaseRenderer
public int getRotation()
public void setPowerMaxValue(int v)
setPowerMaxValue
in class IltBTSAntennaBaseRenderer
public int getPowerMaxValue()
public void setAntennaRadius(int r)
setAntennaRadius
in class IltBTSAntennaBaseRenderer
public int getAntennaRadius()
public void setBeamWidthRadius(int v)
setBeamWidthRadius
in class IltBTSAntennaBaseRenderer
public int getBeamWidthRadius()
public void setPower(float v)
setPower
in class IltBTSAntennaBaseRenderer
public float getPower()
public void setBeam(float v)
setBeam
in class IltBTSAntennaBaseRenderer
public float getBeam()
public void setBeamDirection(int v)
setBeamDirection
in class IltBTSAntennaBaseRenderer
public int getBeamDirection()
public void setBeamWidth(int w)
setBeamWidth
in class IltBTSAntennaBaseRenderer
public int getBeamWidth()
public void setBeamWidthVisible(boolean v)
setBeamWidthVisible
in class IltBTSAntennaBaseRenderer
public boolean isBeamWidthVisible()
public void setBeamWidthBorderVisible(boolean v)
setBeamWidthBorderVisible
in class IltBTSAntennaBaseRenderer
public boolean isBeamWidthBorderVisible()
public void setAntennaVisible(boolean v)
setAntennaVisible
in class IltBTSAntennaBaseRenderer
public boolean isAntennaVisible()
public void setAlphaBeamWidth(float v)
setAlphaBeamWidth
in class IltBTSAntennaBaseRenderer
public float getAlphaBeamWidth()
public void setAntialiasing(boolean antialiasing)
setAntialiasing
in class IltBTSAntennaBaseRenderer
public boolean isAntialiasing()
public IlvRect getRect(IlvPoint center)
IltBTSAntennaBaseRenderer
getRect
in class IltBTSAntennaBaseRenderer
public void initResources()
IltBaseRenderer
This method can be overridden if you want to modify the value of the properties that have been automatically set by JTGO.
If this method is overridden, super.initResources()
should be called after setting your own values.
initResources
in class IltBaseRenderer
protected boolean containsMain(IlvPoint p, IlvPoint tp, IlvTransformer t, IlvRect rect)
IltBaseRenderer
true
only if the point corresponds to a point
drawn by the method drawMain
.
This implementation returns true
if the point tp
is
inside the rectangle rect
, because it is assumed that the
implementation of the drawMain
method fills
rect
.
Note: This method may be overridden to take into account the shape drawn by this base renderer, if it is not rectangular or if it has transparency.
Note: The parameters tp
and rect
are given in
the same coordinate system. The transformer t
has already
been applied to these parameters.
containsMain
in class IltBaseRenderer
p
- The point to be tested.tp
- The point p
transformed by the transformer t
.t
- The transformation that was applied to the object when it was
drawn.rect
- As in draw
.IltBaseRenderer.drawMain(java.awt.Graphics, ilog.views.IlvTransformer, ilog.views.IlvRect)
protected boolean containsExtraBorders(IlvPoint p, IlvPoint tp, IlvTransformer t, IlvRect rect)
IltBaseRenderer
true
only if the point corresponds to a point
drawn by the method drawExtraBorders
.
This implementation returns true
if the point tp
is
one of the pixels drawn by the default implementation of
drawExtraBorders
. It takes into account the dotted border
when drawn, and the rectangular or polygonal borders according to the
value returned by getExtraBorders
.
Note: This method may be overridden to take into account particular borders drawn by a subclass.
Note: The parameters tp
and rect
are given in
the same coordinate system. The transformer t
has already
been applied to these parameters.
containsExtraBorders
in class IltBaseRenderer
p
- The point to be tested.tp
- The point p
transformed by the transformer t
.t
- The transformation that was applied to the object when it was
drawn.rect
- As in draw
.IltBaseRenderer.getExtraBorders(ilog.views.IlvRect)
,
IltBaseRenderer.drawExtraBorders(java.awt.Graphics, ilog.views.IlvTransformer, ilog.views.IlvRect)
public Shape getShape(IlvTransformer transf)
IltBTSAntennaBaseRenderer
getShape
in class IltBTSAntennaBaseRenderer
transf
- The view transformerpublic IlvRect boundingBox(IlvTransformer transf, IlvRect rect, boolean withSelection)
IltBaseRenderer
draw(g,t,rect)
draws into.
The argument rect
is a fresh copy and may be
destructively modified by this function.
This implementation of the function assumes that the main part
fills rect
. Depending on the value returned by
isExtraBorderOutside()
, the function returns rect
, or
rect
enlarged by the width of
the selection border, alarm border and dotted border, if present.
boundingBox
in class IltBaseRenderer
transf
- Transformer applied to the object.rect
- As in draw
.withSelection
- if false
the rect
will not be enlarged by the selection.public void draw(Graphics grp, IlvTransformer transf, IlvRect rect)
IltBaseRenderer
draw
in class IltBTSAntennaBaseRenderer
grp
- The graphics context to draw into.transf
- The transformer that has been applied to rect
. (It is only
passed because drawing with an Ilt2DPalette
requires it.)rect
- The rectangle to draw into. This is a rectangle with
integer coordinates. Its corners have the following coordinates
x1 = rect.x,
x2 = rect.x + rect.width - 1,
y1 = rect.y,
y2 = rect.y + rect.height - 1.
The default implementation of this function calls drawMain
and
drawExtraBorders
.
public void drawMain(Graphics grp, IlvTransformer transf, IlvRect rect)
IltBaseRenderer
drawMain
in class IltBaseRenderer
grp
- As in draw
.transf
- As in draw
.rect
- As in draw
.protected boolean drawSelectionBorder(Graphics grp, IlvTransformer transf, IlvRect rect, int distance)
IltBaseRenderer
drawSelectionBorder
in class IltBaseRenderer
protected boolean drawAlarmBorder(Graphics grp, IlvTransformer transf, IlvRect rect, int distance)
IltBaseRenderer
drawAlarmBorder
in class IltBaseRenderer
protected void drawExtraBorder(Graphics grp, IlvTransformer transf, IlvRect rect, IltPalette palette, int distance, int thickness)
IltBaseRenderer
isExtraBorderOutside()
.
This method is called by drawExtraBorders
for each border that
needs to be drawn (selection, alarm and dotted borders).
The shape of the drawn borders is a rectangle if the dotted border
is visible OR if getExtraBorders
returns null
.
If the dotted border is invisible AND getExtraBorders
returns a non-null array of IltPolygon
,
then these polygons are used as shapes for the borders.
drawExtraBorder
in class IltBaseRenderer
grp
- As in draw
transf
- As in draw
rect
- As in draw
palette
- The palette with the border colorsdistance
- The distance from the main part (not including width)thickness
- The width of the borderIltBaseRenderer.getExtraBorders(ilog.views.IlvRect)
,
IltBaseRenderer.isExtraBorderOutside()
,
IltBaseRenderer.isDottedBorderVisible()
protected void drawExtraBorder(Graphics grp, Shape shape, IltPalette palette)
Shape
.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.