com.jfimagine.jfdraw.gui
Class GlobalSettings

java.lang.Object
  |
  +--com.jfimagine.jfdraw.gui.GlobalSettings

public class GlobalSettings
extends java.lang.Object

Global settings class. A class used to place global settings.

Version:
$Revision: 1.1 $
Author:
CookieMaker

Method Summary
 Arrow getArrow()
          get arrow format
 CanvasFormat getCanvasFormat()
          get canvas format
 FillFormat getFillFormat()
          get fill format
 FontFormat getFontFormat()
          get font format
 java.lang.String getGlobalPath()
          get the global path for open and save files.
static GlobalSettings getInstance()
           
 LineFormat getLineFormat()
          get line format
 int getMeasure()
          get measure type, english or metric
 int getScaleUnit()
          Get the scale unit, a scale unit is something like << 1cm = 100 * [scaleUnit] >>
 double getScaleValue()
          Get the scale value, a scale value is something like << 1cm = [scaleValue] * km >>
 int getScreenUnit()
          Get the screen unit, a screen unit is something like << 1 * [screenUnit] = 1000 * meter >> We only allowed CM or INch for current screen unit.
 boolean isDisablePortSnapping()
          if assigned disable port snapping.
 boolean isExportWithGrid()
          Get if user would like to export/print graph with grid.
 boolean isExportWithRuler()
          Get if user would like to export/print graph with ruler.
 boolean isHidePorts()
          if assigned hidding ports .
 boolean isMetric()
          Get if current measurement is metric or english
 void loadConfigFile()
          Read content from a text config file.
 void setArrow(Arrow arrow)
          set arrow format
 void setCanvasFormat(CanvasFormat canvasFormat)
          set canvas format
 void setDisablePortSnapping(boolean disable)
          set if hide or show ports.
 void setExportWithGrid(boolean withGrid)
          Set export with grid, or not.
 void setExportWithRuler(boolean withRuler)
          Set export with ruler, or not.
 void setFillFormat(FillFormat fillFormat)
          set fill format
 void setFontFormat(FontFormat fontFormat)
          set font format
 void setGlobalPath(java.lang.String path)
          Set the global path.
 void setHidePorts(boolean hide)
          set if hide or show ports.
 void setLineFormat(LineFormat lineFormat)
          set line format
 void setMeasure(int measure)
          set measure type, english or metric
 void setScaleUnit(int unit)
          Set the scale unit
 void setScaleValue(double scale)
          Set the scale value
 void setScreenUnit(int unit)
          Set the screen unit We only allowed CM or INch for current screen unit.
 void writeConfigFile()
          save text config file from current global settings definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMeasure

public int getMeasure()
get measure type, english or metric

Returns:
current measurement type.

setMeasure

public void setMeasure(int measure)
set measure type, english or metric

Parameters:
measure - A new measurement type.

isMetric

public boolean isMetric()
Get if current measurement is metric or english

Returns:
True if is metric, false english.

isHidePorts

public boolean isHidePorts()
if assigned hidding ports .


setHidePorts

public void setHidePorts(boolean hide)
set if hide or show ports.


isDisablePortSnapping

public boolean isDisablePortSnapping()
if assigned disable port snapping.


setDisablePortSnapping

public void setDisablePortSnapping(boolean disable)
set if hide or show ports.


getScaleValue

public double getScaleValue()
Get the scale value, a scale value is something like << 1cm = [scaleValue] * km >>

Returns:
the scale value.

setScaleValue

public void setScaleValue(double scale)
Set the scale value

Parameters:
scale - A new scale value

getScaleUnit

public int getScaleUnit()
Get the scale unit, a scale unit is something like << 1cm = 100 * [scaleUnit] >>

Returns:
the scale unit.

setScaleUnit

public void setScaleUnit(int unit)
Set the scale unit

Parameters:
unit - A new scale unit

getScreenUnit

public int getScreenUnit()
Get the screen unit, a screen unit is something like << 1 * [screenUnit] = 1000 * meter >> We only allowed CM or INch for current screen unit.

Returns:
the screen unit.

setScreenUnit

public void setScreenUnit(int unit)
Set the screen unit We only allowed CM or INch for current screen unit.

Parameters:
unit - A new screen unit

getGlobalPath

public java.lang.String getGlobalPath()
get the global path for open and save files.

Returns:
the global path.

setGlobalPath

public void setGlobalPath(java.lang.String path)
Set the global path.

Parameters:
path - A new global path.

isExportWithGrid

public boolean isExportWithGrid()
Get if user would like to export/print graph with grid.

Returns:
True if export with grid, false otherwise.

setExportWithGrid

public void setExportWithGrid(boolean withGrid)
Set export with grid, or not.

Parameters:
withGrid - if export with grid.

isExportWithRuler

public boolean isExportWithRuler()
Get if user would like to export/print graph with ruler.

Returns:
True if export with ruler, false otherwise.

setExportWithRuler

public void setExportWithRuler(boolean withRuler)
Set export with ruler, or not.

Parameters:
withRuler - if export with ruler.

getArrow

public Arrow getArrow()
get arrow format


setArrow

public void setArrow(Arrow arrow)
set arrow format


getLineFormat

public LineFormat getLineFormat()
get line format


setLineFormat

public void setLineFormat(LineFormat lineFormat)
set line format


getFillFormat

public FillFormat getFillFormat()
get fill format


setFillFormat

public void setFillFormat(FillFormat fillFormat)
set fill format


getFontFormat

public FontFormat getFontFormat()
get font format


setFontFormat

public void setFontFormat(FontFormat fontFormat)
set font format


getCanvasFormat

public CanvasFormat getCanvasFormat()
get canvas format


setCanvasFormat

public void setCanvasFormat(CanvasFormat canvasFormat)
set canvas format


getInstance

public static GlobalSettings getInstance()

loadConfigFile

public void loadConfigFile()
Read content from a text config file.


writeConfigFile

public void writeConfigFile()
save text config file from current global settings definition.



Copyright 2004 ~ 2005 JingFei International Cooperation LTD. All Rights Reserved.