net.sf.freecol.common.option
Interface Option

All Known Implementing Classes:
AboutAction, AbstractOption, ActionManager, AssignTradeRouteAction, AudioMixerOption, BooleanOption, BuildColonyAction, CenterAction, ChangeAction, ChangeWindowedModeAction, ChatAction, ClearOrdersAction, ClientOptions, ColopediaAction, DebugAction, DeclareIndependenceAction, DetermineHighSeasAction, DisbandUnitAction, DisplayBordersAction, DisplayGridAction, DisplayTileTextAction, EndTurnAction, EuropeAction, ExecuteGotoOrdersAction, FileOption, FindSettlementAction, FortifyAction, FreeColAction, GameOptions, GotoAction, GotoTileAction, ImprovementAction, IntegerOption, LanguageOption, ListOption, LoadAction, MapboardAction, MapControlsAction, MapGeneratorOptions, MiniMapZoomInAction, MiniMapZoomOutAction, MoveAction, NewAction, NewEmptyMapAction, OpenAction, OptionGroup, OptionMap, PercentageOption, PreferencesAction, QuitAction, RangeOption, ReconnectAction, RenameAction, ReportCargoAction, ReportColonyAction, ReportContinentalCongressAction, ReportExplorationAction, ReportForeignAction, ReportHighScoresAction, ReportHistoryAction, ReportIndianAction, ReportLabourAction, ReportMilitaryAction, ReportNavalAction, ReportProductionAction, ReportReligionAction, ReportRequirementsAction, ReportTradeAction, ReportTurnAction, RetireAction, SaveAction, SaveAndQuitAction, ScaleMapAction, SelectableAction, SelectOption, SentryAction, ShowMainAction, SkipUnitAction, StringOption, TilePopupAction, ToggleViewModeAction, TradeRouteAction, UnitAction, UnloadAction, WaitAction, ZoomInAction, ZoomOutAction

public interface Option

An option describes something which can be customized by the user.

See Also:
GameOptions

Field Summary
static java.lang.String NO_ID
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
          Adds a new PropertyChangeListener for monitoring state changes.
 java.lang.String getId()
          Returns the id of this Option.
 java.lang.String getName()
          Returns the name of this Option.
 java.lang.String getShortDescription()
          Gives a short description of this Option.
 boolean isPreviewEnabled()
          Should this option be updated directly so that changes may be previewes?
 void readFromXML(javax.xml.stream.XMLStreamReader in)
          Initializes this object from an XML-representation of this object.
 void readFromXMLElement(org.w3c.dom.Element element)
          Initializes this object from an XML-representation of this object.
 void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
          Remove the given PropertyChangeListener.
 java.lang.String toString()
          Returns a textual representation of this object.
 void toXML(javax.xml.stream.XMLStreamWriter out)
          Makes an XML-representation of this object.
 org.w3c.dom.Element toXMLElement(org.w3c.dom.Document document)
          Makes an XML-representation of this object.
 

Field Detail

NO_ID

static final java.lang.String NO_ID
See Also:
Constant Field Values
Method Detail

getShortDescription

java.lang.String getShortDescription()
Gives a short description of this Option. Can for instance be used as a tooltip text.

Returns:
A short description of this action.

toString

java.lang.String toString()
Returns a textual representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The name of this Option.
See Also:
#getLocalizedName

getId

java.lang.String getId()
Returns the id of this Option.

Returns:
The unique identifier as provided in the constructor.

getName

java.lang.String getName()
Returns the name of this Option.

Returns:
The name as provided in the constructor.

isPreviewEnabled

boolean isPreviewEnabled()
Should this option be updated directly so that changes may be previewes?

Returns:
true if changes to this option should be made directly (and reset back later if the changes are not stored).

addPropertyChangeListener

void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
Adds a new PropertyChangeListener for monitoring state changes. Events are generated when variables are changed.

Parameters:
pcl - The PropertyChangeListener to be added.

removePropertyChangeListener

void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
Remove the given PropertyChangeListener.

Parameters:
pcl - The PropertyChangeListener to be removed.

toXMLElement

org.w3c.dom.Element toXMLElement(org.w3c.dom.Document document)
Makes an XML-representation of this object.

Parameters:
document - The document to use when creating new componenets.
Returns:
The DOM-element ("Document Object Model") made to represent this "Option".

readFromXMLElement

void readFromXMLElement(org.w3c.dom.Element element)
Initializes this object from an XML-representation of this object.

Parameters:
element - The DOM-element ("Document Object Model") made to represent this "Option".

readFromXML

void readFromXML(javax.xml.stream.XMLStreamReader in)
                 throws javax.xml.stream.XMLStreamException
Initializes this object from an XML-representation of this object.

Parameters:
in - The input stream with the XML.
Throws:
javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.

toXML

void toXML(javax.xml.stream.XMLStreamWriter out)
           throws javax.xml.stream.XMLStreamException
Makes an XML-representation of this object.

Parameters:
out - The output stream.
Throws:
javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.