com.maryanovsky.map.client.widgets.scale
Class ScaleWidget

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by com.maryanovsky.map.client.widgets.scale.ScaleWidget
All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsRenderable, IsWidget

public class ScaleWidget
extends Composite

A widget displaying the map's scale, that is the amount of real-world distance units (such as kilometers) in a certain amount of pixels. The style name of the widget is map-ScaleWidget. The style name of the element that displays the scale size (the ruler) is map-ScaleWidgetSize. The style name of the label that displays the size label is map-ScaleWidgetText. The actual size label is implemented using two labels - a background and a foreground one (offset by one pixel to the right and to the bottom). Their style names are map-ScaleWidgetBackgroundLabel and map-ScaleWidgetForegroundLabel. In order to properly use this widget's default look, you need to import the "widgets/scale/scale.css" file into the page's CSS.

Author:
Maryanovsky Alexander

Nested Class Summary
static interface ScaleWidget.Images
          A bundle of the images used by the widget.
static interface ScaleWidget.Scale
          Defines the size and values displayed by the scale widget.
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
ScaleWidget(MapWidget mapWidget, ScaleWidget.Scale scale)
          Creates a new ScaleWidget for the specified MapWidget, with the specified scale and default images.
ScaleWidget(MapWidget mapWidget, ScaleWidget.Scale scale, ScaleWidget.Images images)
          Creates a new ScaleWidget for the specified MapWidget, with the specified scale and images.
 
Method Summary
protected  void onLoad()
          Updates the scale on-load.
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScaleWidget

public ScaleWidget(MapWidget mapWidget,
                   ScaleWidget.Scale scale,
                   ScaleWidget.Images images)
Creates a new ScaleWidget for the specified MapWidget, with the specified scale and images.


ScaleWidget

public ScaleWidget(MapWidget mapWidget,
                   ScaleWidget.Scale scale)
Creates a new ScaleWidget for the specified MapWidget, with the specified scale and default images.

Method Detail

onLoad

protected void onLoad()
Updates the scale on-load.

Overrides:
onLoad in class Widget