Package net.xoetrope.xui.style

Examples of net.xoetrope.xui.style.XStyleManager


  {
  }

  public void testStyles()
  {
    XStyleManager style = getStyles();
    assertTrue( style.getStyle("base").getStyleAsString(XStyle.FONT_FACE).compareTo("arial")==0 );
    assertTrue( style.getStyle("base").getStyleAsInt(XStyle.FONT_SIZE)==12 );
    assertTrue( style.getStyle("base/bold/XLabel").getStyleAsInt(XStyle.FONT_SIZE)==16 );

//    style = getStylesWithoutBase();
    assertTrue( style.getStyle("base/bold/XLabel").getStyleAsInt(XStyle.FONT_SIZE)==16 );

//    XStyleManager style = getStyles();
//    assertTrue( style.getStyle("base").getStyleAsString(XStyle.FONT_FACE).compareTo("arial")==0 );
//    assertTrue( style.getStyle("base").getStyleAsInt(XStyle.FONT_SIZE)==12 );
  }
View Full Code Here


  public static XStyleManager getStyles()
  {
//    XResourceManager.getInstance();
//    XResourceManager.setDefaultFile("startup.properties");
    XStyleManager manager = XProjectManager.getStyleManager();
//    XStyleFactory  styleFactory = new XStyleFactory();
    manager.load("configurator.txt");
    return XProjectManager.getStyleManager();
  }
View Full Code Here

    project = XProjectManager.getCurrentProject( applet );
  }

  public void testMetaContent()
  {
    XStyleManager manager = project.getStyleManager();
    XStyleFactory styleFactory = null;

    try {
      styleFactory = new XStyleFactory( project, "net.xoetrope.xui" );
    }
View Full Code Here

   * @param isRgb true to output an RGB color, or false for Hex
   * @return the attribute as a string
   */
  protected String getColorStyleAttribute( String args, int attrib, boolean isRgb, boolean isHSB )
  {
    XStyleManager sm = currentProject.getStyleManager();

    int rScale = 100;
    int gScale = 100;
    int bScale = 100;
    int pos;
    if ( ( pos = args.indexOf( ',' ) ) > 0 ) {
      int pos2 = args.indexOf( ',', pos + 1 );
      int pos3 = args.indexOf( ',', pos2 + 1 );
      rScale = Integer.parseInt( args.substring( pos + 1, pos2 ) );
      gScale = Integer.parseInt( args.substring( pos2 + 1, pos3 ) );
      bScale = Integer.parseInt( args.substring( pos3 + 1 ) );
      args = args.substring( 0, pos );
    }

    Color attribValue = sm.getStyle( args.trim() ).getStyleAsColor( attrib );
    int r = attribValue.getRed();
    int g = attribValue.getGreen();
    int b = attribValue.getBlue();
    if ( !isHSB ) {
      if ( rScale < 100 )
View Full Code Here

        else if ( attribNameLwr.equals( "title" ))
          ((XTitlePainter)painter).setTitle( attribValueStr );
        else if ( attribNameLwr.equals( "titlepos" ))
          ((XTitlePainter)painter).setTitlePosition( Integer.parseInt( attribValueStr ));
        else if ( attribNameLwr.equals( "titlestyle" )) {
          XStyleManager sm = XProjectManager.getStyleManager();
          XStyle xstyle = sm.getStyle( attribValueStr );
          ((XTitlePainter)painter).setTitleColor( xstyle.getStyleAsColor( XStyle.COLOR_BACK ));
          ((XTitlePainter)painter).setTitleTextColor( xstyle.getStyleAsColor( XStyle.COLOR_FORE ));
          ((XTitlePainter)painter).setTitleFont( sm.getFont( attribValueStr ));
        }
      }
    }
    else
      return -1;
View Full Code Here

  }


  private XStyleManager createStyleManager()
  {
    XStyleManager mgr = null;
    String defStyleManager = getStartupParam( "DefaultStyleManager" );
    if ( defStyleManager != null && defStyleManager.length() > 0 ) {
      try {
        Class c = Class.forName( defStyleManager.trim());
        mgr = (XStyleManager) c.newInstance();
      }
      catch ( Exception ex ) {
        if ( BuildProperties.DEBUG )
          DebugLogger.logError( "StyleManager NOT found: " + defStyleManager );
      }
    }
    if ( mgr == null ) {
      mgr = new XStyleManager( this, 10 );
    }
    return mgr;
  }
View Full Code Here

    setContentPane( dockingPanel );
    SwingWidgetAdapter.getInstance();
    applicationContext = new XApplicationContext( this, "net.xoetrope.swing.app.XDockableFrame", args );
   
    // Style the panel
    XStyleManager sm = currentProject.getStyleManager();
    if ( sm.hasStyle( "dockingApp" )) {
      XStyle dockingStyle = sm.getStyle( "dockingApp" );
      multiSplitPane.setBackground( dockingStyle.getStyleAsColor( XStyle.COLOR_BACK ));
      XStyleEx exStyle = (XStyleEx)dockingStyle;
      int idx = exStyle.getStyleIndex( "padding" );
      if ( idx > 0 ) {
        int padding = new Integer( exStyle.getStyleValue( idx ).toString()).intValue();
View Full Code Here

  {
    Color sidebarBkColor = SystemColor.control;
    Color sidebarTextColor = SystemColor.controlText;
    Color sidebarRolloverTextColor = SystemColor.controlText;
   
    XStyleManager sm = currentProject.getStyleManager();
    if ( sm.hasStyle( "dockingSidebar" )) {
      XStyle xstyle = sm.getStyle( "dockingSidebar" );
      sidebarBkColor = xstyle.getStyleAsColor( XStyle.COLOR_BACK );
      sidebarTextColor = xstyle.getStyleAsColor( XStyle.COLOR_FORE );
     
      xstyle = sm.getStyle( "dockingSidebar/active" );
      sidebarRolloverTextColor = xstyle.getStyleAsColor( XStyle.COLOR_FORE );
    }
    target.applyStyles( sidebarBkColor, sidebarTextColor, sidebarRolloverTextColor );
  }
View Full Code Here

   * Set the general style of the XTable
   * @param style XStyle
   */
  public void setStyle( String style )
  {
    XStyleManager styleMgr = currentProject.getStyleManager();
    XStyle xstyle = styleMgr.getStyle( style );
    setForeground( xstyle.getStyleAsColor( XStyle.COLOR_FORE ));
    setBackground( xstyle.getStyleAsColor( XStyle.COLOR_BACK ));
    setFont( styleMgr.getFont( xstyle ));
  }
View Full Code Here

   */
  public void setHeaderStyle( String style )
  {
    if ( style != null ) {
      headerStyle = style;
      XStyleManager styleMgr = currentProject.getStyleManager();
      XStyle xstyle = styleMgr.getStyle( style );
      JTableHeader th = getTableHeader();
   
      th.setForeground( xstyle.getStyleAsColor( XStyle.COLOR_FORE ));
      th.setBackground( xstyle.getStyleAsColor( XStyle.COLOR_BACK ));
      th.setFont( styleMgr.getFont( xstyle ));
    }
  }
View Full Code Here

TOP

Related Classes of net.xoetrope.xui.style.XStyleManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.