|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlt.monarch.chart.AbstractView<E>
public abstract class AbstractView<E extends AbstractPaintTags> extends java.lang.Object implements View, StyleEditorEntity, java.io.Serializable
Default implementation of most utility methods of View
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
layoutInvalid
Specifies whether view layout is invalid. |
protected PaintStyle<E> |
paintStyle
Color style object for getting and setting entityStyle to stylesheet |
Style |
style
Local stylesheet. |
| Constructor and Description |
|---|
AbstractView()
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate()
Prepares the view, when it is added to a view container |
void |
addViewListener(ViewListener listener)
Adds the specified view listener to receive notification when the view is invalidated, activated or deactivated. |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
ViewContainer |
container()
Deprecated. use getContainer() |
protected void |
deactivate()
Cleanups the view, when it is removed from the view container |
void |
dispose()
Cleans this view. |
protected void |
finalize()
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. |
float |
getAlignmentX()
Returns the alignment along the x axis. |
float |
getAlignmentY()
Returns the alignment along the y axis. |
Rectangle2D |
getBounds()
Gets the bounds of this view in the form of a Rectangle object. |
Rectangle2D |
getChartObjectBounds()
Gets bounds of chart object |
ViewContainer |
getContainer()
Gets the view container. |
GraphicsManager.GraphicsType |
getGraphicsType()
Returns graphics type |
double |
getHeight()
Return the current height of this view. |
java.awt.Dimension |
getMaximumSize(AbstractGraphics g)
Gets the maximum size of this view. |
java.awt.Dimension |
getMinimumSize(AbstractGraphics g)
Gets the minimum size of this view. |
PaintMode |
getPaintMode()
Gets view painting mode. |
PaintStyle<E> |
getPaintStyle()
Gets paint style object |
java.lang.Object |
getParent()
Return the parent chart object |
java.awt.Dimension |
getPreferredSize(AbstractGraphics g)
Gets the preferred size of this view in the specified Graphics context. |
java.awt.Dimension |
getSize()
Returns the size of this view in the form of a Dimension object. |
java.awt.Dimension |
getSize(java.awt.Dimension rv)
Store the width/height of this view into "return value" rv and return rv. |
Style |
getStyle()
Gets style of this view. |
AbstractStyle<?> |
getStyle(StyleType styleType)
Gets style object for the stylesheet attributes specified by style type. |
double |
getWidth()
Return the current width of this view. |
double |
getX()
Return the current x coordinate of the views origin. |
double |
getY()
Return the current y coordinate of the views origin. |
void |
invalidate()
Invalidates the view. |
protected boolean |
isLayoutValid()
Determines whether view layout is valid. |
protected void |
layout(AbstractGraphics g)
Prepares the view by arranging all internal views and calculates required constants. |
protected abstract void |
paint(AbstractGraphics g)
Paints the view. |
void |
removeViewListener(ViewListener listener)
Removes the specified view listener so that it no longer receives notifications from this view. |
void |
render(AbstractGraphics g)
Prepares and renders the view. |
void |
repaint()
Repaints entire view. |
void |
repaint(Rectangle2D r)
Repaints the specified view region. |
void |
setAlignmentX(float alignmentX)
Sets the the vertical alignment. |
void |
setAlignmentY(float alignmentY)
Sets the the horizontal alignment. |
void |
setBounds(double x,
double y,
double width,
double height)
Moves and resizes this view. |
void |
setBounds(Rectangle2D r)
Moves and resizes this view to conform to the new bounding rectangle r. |
void |
setContainer(ViewContainer container)
Sets a container for this view. |
void |
setLocation(double x,
double y)
Moves this view to a new location. |
void |
setMaximumSize(int width,
int height)
Sets the maximum size of this view to a constant value. |
void |
setMinimumSize(int width,
int height)
Sets the minimum size of this view to a constant value. |
void |
setPaintMode(PaintMode paintMode)
Sets view painting mode. |
void |
setPreferredSize(int width,
int height)
Sets the preferred size of the receiving view. |
void |
setSize(double width,
double height)
Resizes this view so that it has width width and height. |
void |
validate(AbstractGraphics g)
Validates the view in the specified Graphics context. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface lt.monarch.chart.engine.View |
|---|
getContainingObjects |
| Field Detail |
|---|
public final Style style
protected PaintStyle<E extends AbstractPaintTags> paintStyle
protected boolean layoutInvalid
true, invalidate
does nothing.
| Constructor Detail |
|---|
public AbstractView()
| Method Detail |
|---|
public void addViewListener(ViewListener listener)
addViewListener in interface Viewlistener - the view listenerViewListenerpublic void removeViewListener(ViewListener listener)
removeViewListener in interface Viewlistener - the view listenerViewListenerpublic Style getStyle()
getStyle in interface ViewStylepublic void repaint()
repaint in interface Viewpublic void repaint(Rectangle2D r)
repaint in interface Viewr - the view region to repaintpublic void invalidate()
invalidate in interface Viewpublic void setContainer(ViewContainer container)
container is null, view container is set to
NullViewContainer.instance.
setContainer in interface Viewcontainer - the view containerViewContainer@Deprecated public ViewContainer container()
container in interface ViewViewContainerpublic ViewContainer getContainer()
ViewContainerpublic void setBounds(Rectangle2D r)
setBounds in interface Viewr - the new bounding rectangle for this viewpublic Rectangle2D getBounds()
getBounds in interface Viewpublic java.awt.Dimension getPreferredSize(AbstractGraphics g)
getPreferredSize in interface Viewg - the Graphics context in which view will be paintedpublic final void render(AbstractGraphics g)
render in interface Viewg - graphics contextprotected boolean isLayoutValid()
public void validate(AbstractGraphics g)
validate in interface Viewg - the Graphics context in which view will be paintedprotected void layout(AbstractGraphics g)
g - graphics contextprotected void activate()
protected void deactivate()
protected abstract void paint(AbstractGraphics g)
g - graphics context
public void setLocation(double x,
double y)
x and y.
setLocation in interface Viewx - The x-coordinate of the new location'stop-left corner.y - The y-coordinate of the new location's top-left corner.public double getX()
getX in interface Viewpublic double getY()
getY in interface Viewpublic java.awt.Dimension getMaximumSize(AbstractGraphics g)
getMaximumSize in interface Viewg - the Graphics context in which view will be paintedpublic java.awt.Dimension getMinimumSize(AbstractGraphics g)
getMinimumSize in interface Viewg - the Graphics context in which view will be painted
public void setSize(double width,
double height)
width and height.
setSize in interface Viewwidth - The new width of this view in pixels.height - The new height of this view in pixels.public java.awt.Dimension getSize()
Dimension object. The
height field of the Dimension object contains this view's
height, and the width field of the Dimension object contains
this view's width.
getSize in interface ViewDimension object that indicates the size of this view.public java.awt.Dimension getSize(java.awt.Dimension rv)
getSize in interface Viewrv - the return value, modified to the view sizepublic double getHeight()
getHeight in interface Viewpublic double getWidth()
getWidth in interface View
public void setBounds(double x,
double y,
double width,
double height)
x and y, and the new size is specified by width
and height.
setBounds in interface Viewx - The new x-coordinate of this view.y - The new y-coordinate of this view.width - The new width of this view.height - The new height of this view.
public void setMinimumSize(int width,
int height)
setMinimumSize in interface Viewwidth - the minimum width of the viewheight - the minimum height of the view
public void setMaximumSize(int width,
int height)
setMaximumSize in interface Viewwidth - the maximum width of the viewheight - the maximum height of the view
public void setPreferredSize(int width,
int height)
setPreferredSize in interface Viewwidth - the preferred width of the receiving viewheight - the preferred height of the receiving viewpublic float getAlignmentX()
getAlignmentX in interface Viewpublic float getAlignmentY()
getAlignmentY in interface Viewpublic void setAlignmentX(float alignmentX)
setAlignmentX in interface ViewalignmentX - the alignment along the x axispublic void setAlignmentY(float alignmentY)
setAlignmentY in interface ViewalignmentY - the alignment along the y axispublic void dispose()
dispose in interface Viewpublic java.lang.Object clone()
clone in interface Viewclone in class java.lang.Object
protected void finalize()
throws java.lang.Throwable
cleanup method if it isn't called
yet.
finalize in class java.lang.Objectjava.lang.Throwable - the Exception raised by this methodpublic void setPaintMode(PaintMode paintMode)
paintMode - paint mode constant.public PaintMode getPaintMode()
public PaintStyle<E> getPaintStyle()
public GraphicsManager.GraphicsType getGraphicsType()
getGraphicsType in interface Viewpublic AbstractStyle<?> getStyle(StyleType styleType)
StyleEditorEntity
getStyle in interface StyleEditorEntitystyleType - style type attributespublic Rectangle2D getChartObjectBounds()
StyleEditorEntity
getChartObjectBounds in interface StyleEditorEntitypublic java.lang.Object getParent()
StyleEditorEntity
getParent in interface StyleEditorEntity
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||