org.infai.emo.matcher.editor.preferences
Class GraphicalPreferencesPage

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.preference.PreferencePage
          extended by org.infai.emo.matcher.editor.preferences.GraphicalPreferencesPage
All Implemented Interfaces:
org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.preference.IPreferencePage, org.eclipse.ui.IWorkbenchPreferencePage

public class GraphicalPreferencesPage
extends org.eclipse.jface.preference.PreferencePage
implements org.eclipse.ui.IWorkbenchPreferencePage

This is the preferences-page for the graphical settings of the plug-in.

Version:
1.0.0
Author:
Stanley Hillner
See Also:
PreferencePage, IWorkbenchPreferencePage

Field Summary
private  LineCalculations calculator
          The calculator for getting informations on how to draw the lines.
private  org.eclipse.swt.graphics.Color color
          The color for the matching-lines.
private  org.eclipse.swt.events.PaintListener colorPL
          The PaintListener that contains the field for the color-change on this page.
private  org.eclipse.swt.widgets.Label labelColor
          The describing label for the color-field.
private  org.eclipse.swt.graphics.Color oldLineColor
          The old line color.
private  org.eclipse.swt.widgets.Canvas previewCanvas
          The canvas on which the sample-lines are drawn.
private  java.util.Vector<Line> previewLines
          This Vector contains all drawn lines on this page.
private  org.eclipse.swt.widgets.Text steps
          The size of the steps for one color-grading for the lines.
private  org.eclipse.swt.widgets.Scale stepSizeScale
          This slider serves as a setter for the step-size.
private  double stepsOldValue
          The old value for the step-size.
private  double stepsValue
          The current value of steps
private  org.eclipse.jface.preference.IPreferenceStore store
          The preference-store for the plug-in which manages all set preferences.
private  org.eclipse.swt.widgets.Text threshold
          The threshold that sets the matching-value which is minimum required for a tuple so that a line between its elements will be drawn.
private  double thresholdOldValue
          The old value for the threshold.
private  org.eclipse.swt.widgets.Scale thresholdScale
          This slider serves as a setter for the threshold.
private  double thresholdValue
          The current value of threshold
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
GraphicalPreferencesPage()
           
 
Method Summary
protected  org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
          
 void createControl(org.eclipse.swt.widgets.Composite parent)
          
 void init(org.eclipse.ui.IWorkbench workbench)
          
protected  void performApply()
          
 boolean performCancel()
          
protected  void performDefaults()
          
 boolean performOk()
          
protected  void updateColorLabel()
          Updates the color-chooser-field when another color has been selected.
private  void updateMatchingLines()
          This method updates the matching-lines on every canvas of the editors that are opened.
private  void updatePreview()
          This method is responsible for updating the preview of the made settings.
 
Methods inherited from class org.eclipse.jface.preference.PreferencePage
applyData, applyDialogFont, computeSize, contributeButtons, createDescriptionLabel, createNoteComposite, doComputeSize, doGetPreferenceStore, getApplyButton, getContainer, getDefaultsButton, getPreferenceStore, isValid, noDefaultAndApplyButton, okToLeave, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString, updateApplyButton
 
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getImage, getMessage, getMessageType, getShell, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, setButtonLayoutData, setControl, setDescription, setImageDescriptor, setMessage, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.preference.IPreferencePage
computeSize, isValid, okToLeave, setContainer, setSize
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisible
 

Field Detail

color

private org.eclipse.swt.graphics.Color color
The color for the matching-lines.

See Also:
Color

labelColor

private org.eclipse.swt.widgets.Label labelColor
The describing label for the color-field.

See Also:
Label

threshold

private org.eclipse.swt.widgets.Text threshold
The threshold that sets the matching-value which is minimum required for a tuple so that a line between its elements will be drawn.

See Also:
Text

thresholdScale

private org.eclipse.swt.widgets.Scale thresholdScale
This slider serves as a setter for the threshold.

See Also:
Scale

thresholdValue

private double thresholdValue
The current value of threshold


steps

private org.eclipse.swt.widgets.Text steps
The size of the steps for one color-grading for the lines.
Every matching-value within the given range will be drawn with the same color.

See Also:
Text

stepSizeScale

private org.eclipse.swt.widgets.Scale stepSizeScale
This slider serves as a setter for the step-size.

See Also:
Scale

stepsValue

private double stepsValue
The current value of steps


colorPL

private org.eclipse.swt.events.PaintListener colorPL
The PaintListener that contains the field for the color-change on this page.

See Also:
PaintListener

calculator

private LineCalculations calculator
The calculator for getting informations on how to draw the lines.
It is used to calculate the lines on the sample-field.

See Also:
LineCalculations

previewCanvas

private org.eclipse.swt.widgets.Canvas previewCanvas
The canvas on which the sample-lines are drawn.

See Also:
Canvas

previewLines

private java.util.Vector<Line> previewLines
This Vector contains all drawn lines on this page.

See Also:
Vector, Line

store

private org.eclipse.jface.preference.IPreferenceStore store
The preference-store for the plug-in which manages all set preferences.

See Also:
IPreferenceStore

thresholdOldValue

private double thresholdOldValue
The old value for the threshold.
This value is needed to enable the cancel-method.


stepsOldValue

private double stepsOldValue
The old value for the step-size.
This value is needed to enable the cancel-method.


oldLineColor

private org.eclipse.swt.graphics.Color oldLineColor
The old line color.
This value is needed to enable the cancel-method.

See Also:
Color
Constructor Detail

GraphicalPreferencesPage

public GraphicalPreferencesPage()
Method Detail

createControl

public void createControl(org.eclipse.swt.widgets.Composite parent)

Specified by:
createControl in interface org.eclipse.jface.dialogs.IDialogPage
Overrides:
createControl in class org.eclipse.jface.preference.PreferencePage

createContents

protected org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)

Specified by:
createContents in class org.eclipse.jface.preference.PreferencePage

updatePreview

private void updatePreview()
This method is responsible for updating the preview of the made settings.
It updates the lines on the canvas and the affiliated matching-values.


init

public void init(org.eclipse.ui.IWorkbench workbench)

Specified by:
init in interface org.eclipse.ui.IWorkbenchPreferencePage

performDefaults

protected void performDefaults()

Overrides:
performDefaults in class org.eclipse.jface.preference.PreferencePage

updateColorLabel

protected void updateColorLabel()
Updates the color-chooser-field when another color has been selected.


performApply

protected void performApply()

Overrides:
performApply in class org.eclipse.jface.preference.PreferencePage

performCancel

public boolean performCancel()

Specified by:
performCancel in interface org.eclipse.jface.preference.IPreferencePage
Overrides:
performCancel in class org.eclipse.jface.preference.PreferencePage

performOk

public boolean performOk()

Specified by:
performOk in interface org.eclipse.jface.preference.IPreferencePage
Overrides:
performOk in class org.eclipse.jface.preference.PreferencePage

updateMatchingLines

private void updateMatchingLines()
This method updates the matching-lines on every canvas of the editors that are opened.