|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjhplot.GHPanel
public class GHPanel
Class to build the global panel with graphics. It should be inserted to some frame. It has 4 margins which can be obtained from this class.
| Field Summary | |
|---|---|
protected Color |
backMargin
|
protected GHMargin |
bottomPanel
|
protected int |
bottomSize
|
protected JPanel |
CanvasPanel
|
protected Color |
gTitleColor
|
protected Font |
gTitleFont
|
protected String |
gTitleText
|
protected int |
Height
|
protected GHMargin |
leftPanel
|
protected int |
leftSize
|
protected JPanel |
mainPanel
|
protected GHMargin |
rightPanel
|
protected int |
rightSize
|
protected GHMargin |
topPanel
|
protected int |
topSize
|
protected int |
Width
|
| Constructor Summary | |
|---|---|
GHPanel(int Width,
int Height)
Create a panel with graphics. |
|
| Method Summary | |
|---|---|
void |
addComp(Component a)
Add a component to the main panel |
void |
addGraph(int i1,
int i2,
Component a)
Add a graph or any component in the location given by i1 and i2 |
void |
componentHidden(ComponentEvent e)
|
void |
componentMoved(ComponentEvent e)
|
void |
componentResized(ComponentEvent e)
|
void |
componentShown(ComponentEvent e)
|
static void |
disableDoubleBuffering(Component c)
|
protected void |
disposeGHPanel()
Remove all staff |
static void |
enableDoubleBuffering(Component c)
|
void |
export(String file)
Fast export of the canvas to an image file (depends on the extension, i.e. |
void |
exportDialog(String file)
Export a GHFrame image to an external file: The file extension is very important: *.png - make PNG figure *.eps - make EPS figure *.ps - make PS figure *.jpg - make JPG figure *.pdf - make PDF figure *.SVG - make SVG figure *.EMF - make EMF figure, It will open some dialog in case if the file exists |
void |
exportImage()
Exports the image to some graphic format. |
JPanel |
getCanvasPanel()
get JPanel for the main panel which keeps the central panel and all 4 margins |
Color |
getMarginBackground()
Get color for all global margins |
JPanel |
getMarginPanelBottom()
get JPanel for bottom margin |
JPanel |
getMarginPanelCenter()
get JPanel for central with drawings |
JPanel |
getMarginPanelLeft()
get JPanel for left margin |
JPanel |
getMarginPanelRight()
get JPanel for right margin |
JPanel |
getMarginPanelTop()
get JPanel for top margin |
double |
getMarginSizeBottom()
Get size of the bottom margin as ratio to the main panel |
double |
getMarginSizeLeft()
Get the size of left margin terms of the ratio to the main panel |
double |
getMarginSizeRight()
Get the size of right margin of the global canvas in terms of the ratio to thye global canvas |
double |
getMarginSizeTop()
Get size of the top margin of global canvas in terms of ratio to the main panel |
int |
getSizeX()
Get the width of the main panel which keeps all margins and the central panel (in pixels) |
int |
getSizeY()
Get the height of the main panel which keeps all margins and the central panel (in pixels) |
String |
getTextBottom()
Get the text of bottom margin. |
Color |
getTextBottomColor()
Get the color of bottom margin for the text. |
Color |
getTextBottomColorBack()
Get the background color of bottom margin |
Font |
getTextBottomFont()
Get the font of bottom margin. |
String |
getTextLeft()
Get the text of left margin. |
Color |
getTextLeftColor()
Get the color of bottom margin for the text. |
Color |
getTextLeftColorBack()
Get the background color of left margin |
Font |
getTextLeftFont()
Get the font of left margin. |
double |
getTextPosBottomX()
Get the text position in X relative to widths for bottom margin |
double |
getTextPosBottomY()
Get the text position in Y relative to widths for bottom margin |
double |
getTextPosLeftX()
Get the text position in X relative to widths for left margin |
double |
getTextPosLeftY()
Get the text position in Y relative to widths for left margin |
double |
getTextPosRightX()
Get the text position in X relative to widths for right margin |
double |
getTextPosRightY()
Get the text position in Y relative to widths for right margin |
double |
getTextPosTopX()
Get the text position in X relative to widths for top margin |
double |
getTextPosTopY()
Get the text position in Y relative to widths for top margin |
String |
getTextRight()
Get text of right margin. |
Color |
getTextRightColor()
Get the color of right margin for the text. |
Color |
getTextRightColorBack()
Get the background color of right margin |
Font |
getTextRightFont()
Get the font of right margin. |
int |
getTextRotationBottom()
Get the text rotation for bottom margin |
int |
getTextRotationLeft()
Get the text rotation for left margin |
int |
getTextRotationRight()
Get the text rotation for right margin |
int |
getTextRotationTop()
Get the text rotation for top margin |
String |
getTextTop()
Get text of top margin (title). |
Color |
getTextTopColor()
Get the color of top margin for the text. |
Color |
getTextTopColorBack()
Get the background color of top margin |
Font |
getTextTopFont()
Get the font of top margin |
boolean |
isBorderShown()
is the boarder of margins shown? |
void |
printGraph()
Print the canvas |
void |
resetMargins()
Reset all margins to the default values. |
void |
setGTitle(String sname)
Set the global title with default attributes. |
void |
setGTitle(String sname,
Color c)
Set the global title. |
void |
setGTitle(String sname,
double space)
Set the global title with default attributes. |
void |
setGTitle(String sname,
Font f)
Sets the global title using black color. |
void |
setGTitle(String sname,
Font f,
Color c)
Sets the global title |
void |
setMarginBackground(Color backMargin)
Set color for all global margins |
void |
setMarginSizeBottom(double bottomSize)
Set size of the bottom margin of global canvas in terms of the ratio to the size of the main panel |
void |
setMarginSizeLeft(double leftSize)
Set the size of left margin in term of the ratio to the global panel |
void |
setMarginSizeRight(double rightSize)
Set the size of right margin of the global canvas in terms of the ration to the global panel in X |
void |
setMarginSizeTop(double topSize)
Set size of the top margin of global canvas in terms of the ratio to the size of the main panel |
void |
setSizePanel(int Width,
int Height)
Set the size of the global panel which keeps the central panel and the margins |
void |
setTextBottom(String sname)
Set the global bottom margin with default attributes. |
void |
setTextBottom(String sname,
double space)
Set the global bottom margin with default attributes. |
void |
setTextBottom(String sname,
Font f)
Sets a text on global bottom margin using black color. |
void |
setTextBottom(String sname,
Font f,
Color c)
Sets a text on global bottom margin. |
void |
setTextBottomColorBack(Color c)
Get the background color of bottom margin |
void |
setTextLeft(String sname)
Set the global left margin with default attributes. |
void |
setTextLeft(String sname,
double space)
Set the global left margin with default attributes. |
void |
setTextLeft(String sname,
Font f)
Sets a text on global left margin using black color. |
void |
setTextLeft(String sname,
Font f,
Color c)
Sets a text on global left margin |
void |
setTextLeftColorBack(Color c)
Get the background color of left margin |
void |
setTextPosBottomX(double x)
Set the text position in X relative to width for bottom margin |
void |
setTextPosBottomY(double y)
Set the text position in Y relative to width for bottom margin |
void |
setTextPosLeftX(double x)
Set the text position in X relative to width for left margin |
void |
setTextPosLeftY(double y)
Set the text position in Y relative to width for left margin |
void |
setTextPosRightX(double x)
Set the text position in X relative to width for right margin |
void |
setTextPosRightY(double y)
Set the text position in Y relative to width for right margin |
void |
setTextPosTopX(double x)
Set the text position in X relative to width for top margin |
void |
setTextPosTopY(double y)
Set the text position in Y relative to width for top margin |
void |
setTextRight(String sname)
Set the global right margin with default attributes. |
void |
setTextRight(String sname,
double space)
Set the global right margin with default attributes. |
void |
setTextRight(String sname,
Font f)
Sets a text on global right margin using black color. |
void |
setTextRight(String sname,
Font f,
Color c)
Sets a text on global right margin |
void |
setTextRightColorBack(Color c)
Get the background color of left margin |
void |
setTextRotationBottom(int r)
Set the text rotation for bottom margin |
void |
setTextRotationLeft(int r)
Set the text rotation for left margin |
void |
setTextRotationRight(int r)
Set the text rotation for right margin |
void |
setTextRotationTop(int r)
Set the text rotation for top margin |
void |
setTextTop(String sname)
Set the global top margin with default attributes. |
void |
setTextTop(String sname,
Font f)
Sets a text on global top margin using black color. |
void |
setTextTop(String sname,
Font f,
Color c)
Sets a text on global top margin |
void |
setTextTopColorBack(Color c)
Get the background color of top margin |
void |
showBorders(boolean show)
Show borders of margins for edditing |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected JPanel CanvasPanel
protected JPanel mainPanel
protected GHMargin topPanel
protected int topSize
protected GHMargin leftPanel
protected int leftSize
protected GHMargin rightPanel
protected int rightSize
protected GHMargin bottomPanel
protected int bottomSize
protected Color backMargin
protected String gTitleText
protected Font gTitleFont
protected Color gTitleColor
protected int Width
protected int Height
| Constructor Detail |
|---|
public GHPanel(int Width,
int Height)
Width - in pixelsHeight - in pixels| Method Detail |
|---|
public void exportDialog(String file)
file - name of the file with the image. Use appropriate extension for
the file name for the export.public void export(String file)
file - Output file with the proper extension. If no extension, PNG
file is assumed.
public void addGraph(int i1,
int i2,
Component a)
i1 - location in xi2 - location in ya - componentpublic void setMarginBackground(Color backMargin)
backMargin - public Color getMarginBackground()
public void addComp(Component a)
a - Componentpublic int getSizeX()
public int getSizeY()
public void setGTitle(String sname,
Font f,
Color c)
sname - Titlef - Fontc - Color
public void setTextTop(String sname,
Font f,
Color c)
sname - Titlef - Fontc - Color
public void setTextLeft(String sname,
Font f,
Color c)
sname - Titlef - Fontc - Color
public void setTextRight(String sname,
Font f,
Color c)
sname - Titlef - Fontc - Color
public void setTextBottom(String sname,
Font f,
Color c)
sname - Titlef - Fontc - Colorpublic String getTextBottom()
public Font getTextBottomFont()
public Color getTextBottomColor()
public String getTextLeft()
public Font getTextLeftFont()
public Color getTextLeftColor()
public String getTextTop()
public Font getTextTopFont()
public Color getTextTopColor()
public String getTextRight()
public Font getTextRightFont()
public Color getTextRightColor()
public void setGTitle(String sname,
Font f)
sname - Title namef - Font
public void setTextLeft(String sname,
Font f)
sname - Titlef - Font
public void setTextTop(String sname,
Font f)
sname - Titlef - Font
public void setTextRight(String sname,
Font f)
sname - Titlef - Font
public void setTextBottom(String sname,
Font f)
sname - Titlef - Fontpublic void setGTitle(String sname)
sname - Title
public void setGTitle(String sname,
double space)
sname - Titlespace - size of the top margin (0-1)public void setTextLeft(String sname)
sname - Title
public void setTextLeft(String sname,
double space)
sname - Titlespace - size of the left margin (0-1)public void setTextRight(String sname)
sname - Title
public void setTextRight(String sname,
double space)
sname - Titlespace - size of the right margin (0-1)public void setTextBottom(String sname)
sname - Titlepublic void setTextTop(String sname)
sname - Titlepublic void resetMargins()
public void setTextBottom(String sname,
double space)
sname - Titlespace - size of the bottom margin (0-1)
public void setGTitle(String sname,
Color c)
sname - Titlec - Colorpublic JPanel getMarginPanelLeft()
public JPanel getMarginPanelRight()
public JPanel getMarginPanelTop()
public JPanel getMarginPanelBottom()
public JPanel getMarginPanelCenter()
public JPanel getCanvasPanel()
public void setTextRotationTop(int r)
r - rotation (0, 90, -90)public int getTextRotationTop()
public void setTextRotationLeft(int r)
r - rotation (0, 90, -90)public int getTextRotationLeft()
public void setTextRotationRight(int r)
r - rotation (0, 90, -90)public int getTextRotationRight()
public void setTextRotationBottom(int r)
r - rotation (0, 90, -90)public int getTextRotationBottom()
public void setTextPosTopX(double x)
x - position of text in X (from 0 to 1)public void setTextPosTopY(double y)
y - position of text in Y (from 0 to 1)public double getTextPosTopX()
public double getTextPosTopY()
public void setTextPosLeftX(double x)
x - position of text in X (from 0 to 1)public void setTextPosLeftY(double y)
y - position of text in Y (from 0 to 1)public double getTextPosLeftX()
public double getTextPosLeftY()
public void setTextPosRightX(double x)
x - position of text in X (from 0 to 1)public void setTextPosRightY(double y)
y - position of text in Y (from 0 to 1)public double getTextPosRightX()
public double getTextPosRightY()
public void setTextPosBottomX(double x)
x - position of text in X (from 0 to 1)public void setTextPosBottomY(double y)
y - position of text in Y (from 0 to 1)public double getTextPosBottomX()
public double getTextPosBottomY()
public Color getTextBottomColorBack()
public void setTextBottomColorBack(Color c)
c - Colorpublic Color getTextTopColorBack()
public void setTextTopColorBack(Color c)
c - Colorpublic Color getTextLeftColorBack()
public void setTextLeftColorBack(Color c)
c - Colorpublic Color getTextRightColorBack()
public void setTextRightColorBack(Color c)
c - Colorprotected void disposeGHPanel()
public void showBorders(boolean show)
show - true if shownpublic boolean isBorderShown()
public void exportImage()
public void printGraph()
public void setMarginSizeRight(double rightSize)
rightSize - size of the right margin (from 0 to 1)public static void disableDoubleBuffering(Component c)
public static void enableDoubleBuffering(Component c)
public double getMarginSizeRight()
public void setMarginSizeLeft(double leftSize)
leftSize - size of the margin from 0 to 1public double getMarginSizeLeft()
public void setMarginSizeBottom(double bottomSize)
bottomSize - size of the bottom margin from 0 to 1public void setMarginSizeTop(double topSize)
topSize - size of the top margin from 0 to 1public double getMarginSizeBottom()
public void setSizePanel(int Width,
int Height)
Width - WidthHeight - Heightpublic double getMarginSizeTop()
public void componentResized(ComponentEvent e)
componentResized in interface ComponentListenerpublic void componentMoved(ComponentEvent e)
componentMoved in interface ComponentListenerpublic void componentShown(ComponentEvent e)
componentShown in interface ComponentListenerpublic void componentHidden(ComponentEvent e)
componentHidden in interface ComponentListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||