|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectLayout.DisplayPanel
public abstract class DisplayPanel
A standard display panel that can be incorporated into other displays, eg. the Spectorgram window. Provides a JPanel and optionally axis to be drawn around it.
The programmer must always implement the function containerNotification in order to clear the display panel ahead of where the spectrogram is currently drawing.
There are two principle ways of drawing new data on the panel:
DisplayPanelContainer,
DisplayPanelProvider,
DisplayProviderList| Nested Class Summary | |
|---|---|
(package private) class |
DisplayPanel.DisplayInnerPanel
|
(package private) class |
DisplayPanel.PopupListener
|
| Field Summary | |
|---|---|
private java.awt.image.BufferedImage |
displayImage
|
protected DisplayPanelContainer |
displayPanelContainer
|
protected DisplayPanelProvider |
displayPanelProvider
|
private int |
imageHeight
|
private int |
imageWidth
|
private DisplayPanel.DisplayInnerPanel |
innerPanel
|
private javax.swing.JPanel |
outerPanel
|
private java.awt.Insets |
panelInsets
|
protected java.awt.Color |
plotBackground
|
private javax.swing.JPopupMenu |
popupMenu
|
| Constructor Summary | |
|---|---|
DisplayPanel(DisplayPanelProvider displayPanelProvider,
DisplayPanelContainer displayPanelContainer)
Standard Display panel constructor |
|
| Method Summary | |
|---|---|
void |
clearImage()
Clear the entire image |
void |
clearImage(int x1,
int x2)
Clear part of the image between x1 and x2 |
void |
clearImage(int x1,
int x2,
boolean drawLine)
Clear part of the image and draw a line just to the right of the cleared section |
abstract void |
containerNotification(DisplayPanelContainer displayContainer,
int noteType)
Called by the DisplayPanelContainer whenever the scales change - e.g. |
private void |
createImage()
Creates a buffered image for the actual drawing. |
protected javax.swing.JPopupMenu |
createPopupMenu()
Create a popup menu. |
abstract void |
destroyPanel()
The displayPanelContainer should call destroyPanel when the panel is no longer required so that the displayPanel can unsubscribe to any data it was observing. |
private void |
floodImage(java.awt.Color col)
Fill the entire image with the same comour |
java.awt.image.BufferedImage |
getDisplayImage()
|
DisplayPanelContainer |
getDisplayPanelContainer()
|
DisplayPanelProvider |
getDisplayPanelProvider()
|
PamAxis |
getEastAxis()
|
int |
getInnerHeight()
|
javax.swing.JPanel |
getInnerPanel()
|
int |
getInnerWidth()
|
PamAxis |
getNorthAxis()
|
javax.swing.JPanel |
getPanel()
Each display panel must be able to provide a JPanel for incoropation into the display. |
java.awt.Insets |
getPanelBorder()
|
PamAxis |
getSouthAxis()
|
PamAxis |
getWestAxis()
|
void |
repaint()
repaints the display - needs to be called after any changes to the image |
void |
repaint(int t)
repaints the display - needs to be called after any changes to the image |
private void |
setInnerPanel(DisplayPanel.DisplayInnerPanel innerPanel)
|
void |
setPanelBorder(java.awt.Insets panelInsets)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DisplayPanelProvider displayPanelProvider
protected DisplayPanelContainer displayPanelContainer
private javax.swing.JPanel outerPanel
private DisplayPanel.DisplayInnerPanel innerPanel
private java.awt.image.BufferedImage displayImage
private java.awt.Insets panelInsets
private int imageWidth
private int imageHeight
protected java.awt.Color plotBackground
private javax.swing.JPopupMenu popupMenu
| Constructor Detail |
|---|
public DisplayPanel(DisplayPanelProvider displayPanelProvider,
DisplayPanelContainer displayPanelContainer)
Creates two J Panels, one nested inside the other with a small border. The inner panel also has a BufferedImage drawn in it which can be used for any graphics.
displayPanelProvider - displayPanelContainer - | Method Detail |
|---|
private void createImage()
private void floodImage(java.awt.Color col)
col - protected javax.swing.JPopupMenu createPopupMenu()
This should be overridden in any sub classes that want to present a menu for setting any display options.
public void clearImage()
public void clearImage(int x1,
int x2)
x1 - x2 -
public void clearImage(int x1,
int x2,
boolean drawLine)
x1 - x position of start of clearx2 - x position of end of cleardrawLine - draw a vertical line to show cleared regionpublic int getInnerWidth()
public int getInnerHeight()
public java.awt.image.BufferedImage getDisplayImage()
public java.awt.Insets getPanelBorder()
public void setPanelBorder(java.awt.Insets panelInsets)
public final javax.swing.JPanel getPanel()
public javax.swing.JPanel getInnerPanel()
public void repaint()
public void repaint(int t)
t - time delayprivate void setInnerPanel(DisplayPanel.DisplayInnerPanel innerPanel)
public abstract void destroyPanel()
public abstract void containerNotification(DisplayPanelContainer displayContainer,
int noteType)
The display panel can use this information in two ways:
Firstly, it should clear the region of the display just ahead of the current spectrogram x coordinate. Secondly, it may draw additional data on the display.
displayContainer - noteType - public PamAxis getNorthAxis()
public PamAxis getSouthAxis()
public PamAxis getEastAxis()
public PamAxis getWestAxis()
public DisplayPanelContainer getDisplayPanelContainer()
public DisplayPanelProvider getDisplayPanelProvider()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||