Esempio n. 1
0
  @Override
  public void startup(Display display, Map<String, String> properties) throws Exception {
    /* TODO: Not sure that skin mapping should go here... */
    Theme theme = Theme.getTheme();
    theme.set(TopiaryView.class, TopiaryViewSkin.class);

    BXMLSerializer bxmlSerializer = new BXMLSerializer();
    window = (SyntopWindow) bxmlSerializer.readObject(MainApp.class, "syntop.bxml");
    window.open(display);

    // See if a tree string has been specified
    String treeSpecification = properties.get("treespec");
    if (treeSpecification != null) {
      window.setTreeSpecificationText(treeSpecification);
    }

    window.applyTreeSpecificationText();

    // See if an output file has been specified
    String outputSVGfile = properties.get("svgfile");
    if (outputSVGfile != null) {
      window.makeSVGfile(outputSVGfile);
    }

    // See if quitting has been specified
    if (properties.containsKey("terminate")) {
      shutdown(false);
    }
  }
  @Override
  public void install(Component component) {
    super.install(component);

    ScrollBar scrollBar = (ScrollBar) component;
    scrollBar.getScrollBarListeners().add(this);
    scrollBar.getScrollBarValueListeners().add(this);

    scrollBar.add(scrollUpButton);
    scrollBar.add(scrollDownButton);
    scrollBar.add(handle);

    TerraTheme theme = (TerraTheme) Theme.getTheme();

    Color backgroundColor = theme.getColor(9);
    Color brightBackgroundColor = TerraTheme.brighten(backgroundColor);

    GradientPaint backgroundPaint;
    if (scrollBar.getOrientation() == Orientation.HORIZONTAL) {
      backgroundPaint =
          new GradientPaint(0, 1, backgroundColor, 0, DEFAULT_THICKNESS - 2, brightBackgroundColor);
    } else {
      backgroundPaint =
          new GradientPaint(1, 0, backgroundColor, DEFAULT_THICKNESS - 2, 0, brightBackgroundColor);
    }

    setBackgroundPaint(backgroundPaint);

    enabledChanged(scrollBar);
  }
 public TerraScrollBarSkin() {
   TerraTheme theme = (TerraTheme) Theme.getTheme();
   minimumHandleLength = 31;
   borderColor = theme.getColor(7);
   scrollButtonImageColor = theme.getColor(1);
   scrollButtonBackgroundColor = theme.getColor(10);
   scrollButtonDisabledBackgroundColor = theme.getColor(10);
   scrollButtonPressedBackgroundColor = theme.getColor(9);
   scrollButtonHighlightedBackgroundColor = theme.getColor(11);
 }
 public final void setScrollButtonHighlightedBackgroundColor(
     int scrollButtonHighlightedBackgroundColor) {
   TerraTheme theme = (TerraTheme) Theme.getTheme();
   setScrollButtonHighlightedBackgroundColor(
       theme.getColor(scrollButtonHighlightedBackgroundColor));
 }
 public final void setScrollButtonImageColor(int scrollButtonImageColor) {
   TerraTheme theme = (TerraTheme) Theme.getTheme();
   setScrollButtonImageColor(theme.getColor(scrollButtonImageColor));
 }
 public final void setBorderColor(int borderColor) {
   TerraTheme theme = (TerraTheme) Theme.getTheme();
   setBorderColor(theme.getColor(borderColor));
 }
 public final void setBackgroundColor(int backgroundColor) {
   TerraTheme theme = (TerraTheme) Theme.getTheme();
   setBackgroundColor(theme.getColor(backgroundColor));
 }