Package ptolemy.actor.lib.gui
Class PlotterBaseJavaSE
- java.lang.Object
-
- ptolemy.actor.lib.gui.PlotterBaseJavaSE
-
- All Implemented Interfaces:
PlotterBaseInterface
public class PlotterBaseJavaSE extends java.lang.Object implements PlotterBaseInterface
Java SE implementation of PlotterBaseInterface. The code is largely based on the original platform dependent version of the PlotterBase but was moved here in order to support portability of the actor.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Edward A. Lee Contributors: Anar Huseynov
- Pt.AcceptedRating:
- Red (ahuseyno)
- Pt.ProposedRating:
- Red (ahuseyno)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
PlotterBaseJavaSE.PlotWindowTableau
Tableau that creates a PlotterPlotFrame.
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Container
_container
Container into which this plot should be placed.protected PlotTableauFrame
_frame
Frame into which plot is placed, if any.protected SizeAttribute
_plotSize
An attribute that contains the size of the plot.protected PlotterBase
_plotterBase
The base instance that created the implementation.protected PlotterBaseJavaSE.PlotWindowTableau
_tableau
The Plotter tableau.protected ptolemy.actor.lib.gui.PlotterBaseJavaSE.WindowClosingAdapter
_windowClosingAdapter
A reference to the listener for removal purposes.protected WindowPropertiesAttribute
_windowProperties
An attribute tha contains the size and position of the window.
-
Constructor Summary
Constructors Constructor Description PlotterBaseJavaSE()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bringToFront()
Show and then bing the frame to the front.void
cleanUp()
Free up memory when closing.java.lang.Object
getFrame()
Get the plotter's frame.java.lang.Object
getPlatformContainer()
Get the platform dependent container that contains the plotter.java.lang.Object
getTableau()
Get the plotter tableau.void
init(PlotterBase plotterBase)
Initialize the implementation.void
initializeEffigy()
Initialize the effigy of the plotter.void
initWindowAndSizeProperties()
Initialize the effigy of the plotter.PlotBoxInterface
newPlot()
Create a new instance of the PlotBoxInterface implementation.void
remove()
Remove the plot from the current container, if there is one.void
removeNullContainer()
Remove the plot from the frame if the container is null.void
setFrame(java.lang.Object frame)
Set the frame of the plotter.void
setPlatformContainer(java.lang.Object container)
Set the platform dependent container of the plotter.void
setTableauTitle(java.lang.String title)
Set the title of the tableau.void
updateSize()
Update size attribute of the plotter.void
updateWindowAndSizeAttributes()
Update values of the attributes.
-
-
-
Field Detail
-
_container
protected java.awt.Container _container
Container into which this plot should be placed.
-
_frame
protected transient PlotTableauFrame _frame
Frame into which plot is placed, if any.
-
_plotSize
protected SizeAttribute _plotSize
An attribute that contains the size of the plot.
-
_plotterBase
protected PlotterBase _plotterBase
The base instance that created the implementation.
-
_tableau
protected PlotterBaseJavaSE.PlotWindowTableau _tableau
The Plotter tableau.
-
_windowClosingAdapter
protected ptolemy.actor.lib.gui.PlotterBaseJavaSE.WindowClosingAdapter _windowClosingAdapter
A reference to the listener for removal purposes.
-
_windowProperties
protected WindowPropertiesAttribute _windowProperties
An attribute tha contains the size and position of the window.
-
-
Method Detail
-
bringToFront
public void bringToFront()
Show and then bing the frame to the front.- Specified by:
bringToFront
in interfacePlotterBaseInterface
-
cleanUp
public void cleanUp()
Free up memory when closing.- Specified by:
cleanUp
in interfacePlotterBaseInterface
-
getFrame
public java.lang.Object getFrame()
Get the plotter's frame.- Specified by:
getFrame
in interfacePlotterBaseInterface
- Returns:
- the plotter's frame.
- See Also:
setFrame(Object)
-
getPlatformContainer
public java.lang.Object getPlatformContainer()
Get the platform dependent container that contains the plotter.- Specified by:
getPlatformContainer
in interfacePlotterBaseInterface
- Returns:
- the platform dependent container.
- See Also:
setPlatformContainer(Object)
-
getTableau
public java.lang.Object getTableau()
Get the plotter tableau.- Specified by:
getTableau
in interfacePlotterBaseInterface
- Returns:
- the plotter tableau.
-
init
public void init(PlotterBase plotterBase)
Initialize the implementation.- Specified by:
init
in interfacePlotterBaseInterface
- Parameters:
plotterBase
- the instance that created the implementation.
-
initializeEffigy
public void initializeEffigy() throws IllegalActionException
Initialize the effigy of the plotter.- Specified by:
initializeEffigy
in interfacePlotterBaseInterface
- Throws:
IllegalActionException
- If there is a problem initializing the effigy
-
initWindowAndSizeProperties
public void initWindowAndSizeProperties() throws IllegalActionException, NameDuplicationException
Initialize the effigy of the plotter.- Specified by:
initWindowAndSizeProperties
in interfacePlotterBaseInterface
- Throws:
IllegalActionException
- If there is a problem initializing the effigyNameDuplicationException
- if there is a problem creating the attributes.
-
newPlot
public PlotBoxInterface newPlot()
Create a new instance of the PlotBoxInterface implementation.- Specified by:
newPlot
in interfacePlotterBaseInterface
- Returns:
- a new instance of the PlotBoxInterface implementation.
-
remove
public void remove()
Remove the plot from the current container, if there is one.- Specified by:
remove
in interfacePlotterBaseInterface
-
removeNullContainer
public void removeNullContainer()
Remove the plot from the frame if the container is null.- Specified by:
removeNullContainer
in interfacePlotterBaseInterface
-
setFrame
public void setFrame(java.lang.Object frame)
Set the frame of the plotter.- Specified by:
setFrame
in interfacePlotterBaseInterface
- Parameters:
frame
- The frame to set.- See Also:
getFrame()
-
setPlatformContainer
public void setPlatformContainer(java.lang.Object container)
Set the platform dependent container of the plotter. The container can be AWT container or Android view.- Specified by:
setPlatformContainer
in interfacePlotterBaseInterface
- Parameters:
container
- the platform dependent container.- See Also:
getPlatformContainer()
-
setTableauTitle
public void setTableauTitle(java.lang.String title)
Set the title of the tableau.- Specified by:
setTableauTitle
in interfacePlotterBaseInterface
- Parameters:
title
- the title to set.
-
updateSize
public void updateSize()
Update size attribute of the plotter.- Specified by:
updateSize
in interfacePlotterBaseInterface
-
updateWindowAndSizeAttributes
public void updateWindowAndSizeAttributes()
Update values of the attributes.- Specified by:
updateWindowAndSizeAttributes
in interfacePlotterBaseInterface
-
-