org.malai.instrument
Class WidgetInstrument

java.lang.Object
  extended by org.malai.instrument.Instrument
      extended by org.malai.instrument.WidgetInstrument
All Implemented Interfaces:
ActionHandler, Preferenciable, Modifiable, Reinitialisable, UndoHandler
Direct Known Subclasses:
CopierCutterPaster, DrawingPropertiesCustomiser, EditingSelector, Exporter, FileLoaderSaver, Helper, MagneticGridCustomiser, PreferencesActivator, ShapeDeleter, ShapePropertyCustomiser, UndoRedoManager

public abstract class WidgetInstrument
extends Instrument

Defines an abstract model of an instrument that has widgets.

This file is part of libMalai.
Copyright (c) 2009-2012 Arnaud BLOUIN

libMalan is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

deactivate libMalan is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Version:
0.2
Author:
Arnaud BLOUIN

Field Summary
protected  UIComposer<?> composer
          The composer that manages the widgets of the instrument.
 
Fields inherited from class org.malai.instrument.Instrument
activated, eventables, links, modified
 
Constructor Summary
WidgetInstrument(UIComposer<?> composer)
          Creates the instrument.
 
Method Summary
 UIComposer<?> getComposer()
           
protected abstract  void initialiseWidgets()
          Initialises the widgets of the instrument.
 void setActivated(boolean activated, boolean hide)
          Activates or deactivates the instrument.
 
Methods inherited from class org.malai.instrument.Instrument
addEventable, addLink, clearEvents, getLinks, getSizeLinks, hasLinks, initialiseLinks, interimFeedback, isActivated, isModified, load, onActionAborted, onActionAdded, onActionCancelled, onActionDone, onActionExecuted, onUndoableAdded, onUndoableRedo, onUndoableUndo, reinit, removeLink, save, setActivated, setModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

composer

protected UIComposer<?> composer
The composer that manages the widgets of the instrument.

Constructor Detail

WidgetInstrument

public WidgetInstrument(UIComposer<?> composer)
Creates the instrument. Does not call initialiseWidgets().

Parameters:
composer - The composer that manages the widgets of the instrument.
Throws:
java.lang.IllegalArgumentException - If the given argument is null.
Since:
0.2
Method Detail

setActivated

public void setActivated(boolean activated,
                         boolean hide)
Activates or deactivates the instrument. This operation is related to Instrument.setActivated(boolean) but the difference is that is this opedeactivateration another parameter can be used to define is the widgets of the instrument must be hidden: in some cases, deactivating the instrument just implies disabling its widgets (but they are still visible); in some others cases, deactivating the instrument means hiding the widgets. Should be overridden to define the process of hiding the widgets.

Parameters:
activated - True = activation.
hide - If true the widgets will be hidden. Only while deactivating the instrument.
Since:
0.2

initialiseWidgets

protected abstract void initialiseWidgets()
Initialises the widgets of the instrument.

Since:
0.2

getComposer

public UIComposer<?> getComposer()
Returns:
The composer that manages the widgets of the instrument.
Since:
0.2