org.vectomatic.svg.samples.client
Class SampleBase

java.lang.Object
  extended by org.vectomatic.svg.samples.client.SampleBase
Direct Known Subclasses:
AboutSample, EventSample, FeaturesSample, ParserSample, ShapesSample, SmilSample, WidgetsSample

public abstract class SampleBase
extends Object

Base class for lib-gwt-svg samples. All samples are stored in a tab panel with three tabs.

  1. The first tab contains the result of the sample code execution
  2. The second tab contains the source code for the sample
  3. The third tab contains the UiBinder code for the sample
    1. Author:
      laaglu

      Field Summary
      static String HTML_SRC_DIR
                Directory where HTML-ified source code is generated
       com.google.gwt.user.client.ui.HTML sourceHtml
                The HTML-ified source code
       com.google.gwt.user.client.ui.TabLayoutPanel tabPanel
                The tab panel containing this sample
      static String UIBINDER_SRC_DIR
                Directory where HTML-ified UiBinder code is generated
       com.google.gwt.user.client.ui.HTML uiBinderHtml
                The HTML-ified UiBinder code
       
      Constructor Summary
      SampleBase()
                 
       
      Method Summary
      protected  void createCodeTabs(String sampleName)
                Dynamically create the source code tab and UiBinder code tab
      abstract  com.google.gwt.user.client.ui.TabLayoutPanel getPanel()
                Instantiates the tab panel which contains the sample
      protected  void requestCodeContents(String partialPath, com.google.gwt.user.client.ui.HTML html)
                Load the sample HTML source code
      protected  void resize(int width, int height)
                Resizes the sample
       
      Methods inherited from class java.lang.Object
      clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
       

      Field Detail

      HTML_SRC_DIR

      public static final String HTML_SRC_DIR
      Directory where HTML-ified source code is generated

      See Also:
      Constant Field Values

      UIBINDER_SRC_DIR

      public static final String UIBINDER_SRC_DIR
      Directory where HTML-ified UiBinder code is generated

      See Also:
      Constant Field Values

      sourceHtml

      public com.google.gwt.user.client.ui.HTML sourceHtml
      The HTML-ified source code


      uiBinderHtml

      public com.google.gwt.user.client.ui.HTML uiBinderHtml
      The HTML-ified UiBinder code


      tabPanel

      @UiField
      public com.google.gwt.user.client.ui.TabLayoutPanel tabPanel
      The tab panel containing this sample

      Constructor Detail

      SampleBase

      public SampleBase()
      Method Detail

      getPanel

      public abstract com.google.gwt.user.client.ui.TabLayoutPanel getPanel()
      Instantiates the tab panel which contains the sample

      Returns:

      createCodeTabs

      protected void createCodeTabs(String sampleName)
      Dynamically create the source code tab and UiBinder code tab

      Parameters:
      sampleName - The name of the sample

      requestCodeContents

      protected void requestCodeContents(String partialPath,
                                         com.google.gwt.user.client.ui.HTML html)
      Load the sample HTML source code


      resize

      protected void resize(int width,
                            int height)
      Resizes the sample



      Copyright © 2011. All Rights Reserved.