org.vectomatic.client.rep.controller
Class StyleController

java.lang.Object
  extended by org.vectomatic.client.rep.controller.ControllerBase
      extended by org.vectomatic.client.rep.controller.StyleController
All Implemented Interfaces:
com.google.gwt.user.client.ui.ChangeListener, EventListener, IController, IShapeSelectionListener

public class StyleController
extends ControllerBase
implements IShapeSelectionListener, com.google.gwt.user.client.ui.ChangeListener

Class to manage changes of the color or transparency of a shape

Author:
Lukas Laag

Field Summary
 
Fields inherited from class org.vectomatic.client.rep.controller.ControllerBase
_app
 
Constructor Summary
StyleController(RepApplication app, String label, Attribute styleAttribute, Attribute opacityAttribute, IStyle defaultStyle, FloatAttributeValue defaultOpacity)
           
 
Method Summary
 FloatAttributeValue getOpacity()
          Returns the currently selected opacity This method is called by controllers which instantiate new shapes
 IStyle getStyle()
          Returns the currently selected style.
 Attribute getStyleAttribute()
           
 com.google.gwt.user.client.ui.Widget getWidget()
           
 void onChange(com.google.gwt.user.client.ui.Widget sender)
          Invoked when the user changes the list box.
 void selectionChanged(ShapeSelection selection)
           
 void setOpacity(FloatAttributeValue opacity)
          Invoked when the user changes the opacity in the color menu
 void setStyle(IStyle style)
          Invoked when the user changes the color in the color menu
 
Methods inherited from class org.vectomatic.client.rep.controller.ControllerBase
activate, deactivate, keyDown, keyPress, keyUp, mouseDown, mouseMove, mouseUp, render
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleController

public StyleController(RepApplication app,
                       String label,
                       Attribute styleAttribute,
                       Attribute opacityAttribute,
                       IStyle defaultStyle,
                       FloatAttributeValue defaultOpacity)
Method Detail

getWidget

public com.google.gwt.user.client.ui.Widget getWidget()

selectionChanged

public void selectionChanged(ShapeSelection selection)
Specified by:
selectionChanged in interface IShapeSelectionListener

onChange

public void onChange(com.google.gwt.user.client.ui.Widget sender)
Invoked when the user changes the list box.

Specified by:
onChange in interface com.google.gwt.user.client.ui.ChangeListener

setOpacity

public void setOpacity(FloatAttributeValue opacity)
Invoked when the user changes the opacity in the color menu

Parameters:
opacity -

setStyle

public void setStyle(IStyle style)
Invoked when the user changes the color in the color menu


getStyle

public IStyle getStyle()
Returns the currently selected style. This method is called by controllers which instantiate new shapes

Returns:

getOpacity

public FloatAttributeValue getOpacity()
Returns the currently selected opacity This method is called by controllers which instantiate new shapes

Returns:

getStyleAttribute

public Attribute getStyleAttribute()


Copyright © 2010. All Rights Reserved.