Package net.xoetrope.xui.style

Examples of net.xoetrope.xui.style.XStyle


   * @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

   * Set the style of the selected row
   * @param style XStyle
   */
  public void setSelectedStyle( String style )
  {
    XStyle xstyle = currentProject.getStyleManager().getStyle( style );
    Color c = xstyle.getStyleAsColor( XStyle.COLOR_FORE );
    if ( c != null )
      setSelectionForeground( c );
   
    c = xstyle.getStyleAsColor( XStyle.COLOR_BACK );
    if ( c != null )
      setSelectionBackground( c );
  }
View Full Code Here

   * Set the style of the border
   * @param styleName the style name
   */
  public void setBorderStyle( String styleName )
  {
    XStyle style = currentProject.getStyleManager().getStyle( styleName );

    Color borderColor = style.getStyleAsColor( XStyle.COLOR_FORE );
    setBorder( new LineBorder( borderColor ));
  }
View Full Code Here

   * @param styleName the style to lookup
   */
  public static void applyStyle( XProject currentProject, Object comp, String styleName )
  {
    XStyleManager styleManager = currentProject.getStyleManager();
    XStyle xstyle = styleManager.getStyle( styleName );
    WidgetAdapter adapter = WidgetAdapter.getInstance();
    if ( xstyle != null ) {
      adapter.setFont( comp, styleManager.getFont( xstyle ) );
      adapter.setBackground( comp, xstyle.getStyleAsColor( XStyle.COLOR_BACK ) );
      adapter.setForeground( comp, xstyle.getStyleAsColor( XStyle.COLOR_FORE ) );

      if ( comp instanceof XStyleComponent )
        (( XStyleComponent)comp).setStyle( styleName );
    }
  }
View Full Code Here

  public void paintDesktopPaneBackground( SynthContext context, Graphics g, int x, int y, int w, int h )
  {
    JComponent c = (JComponent)context.getComponent();
    String startStyle = ( String ) UIManager.get( "Desktop.desktopStyle" );
    XStyleManager sm = currentProject.getStyleManager();
    XStyle panelStyle = sm.getStyle( startStyle );
    Color start = panelStyle.getStyleAsColor( XStyle.COLOR_FORE );
    Color end = panelStyle.getStyleAsColor( XStyle.COLOR_BACK );

//    c.setForeground( start );
//    c.setBackground( end );
//    g.setColor( java.awt.Color.white );
    painter.paint( (Graphics2D)g, c, w, h );
View Full Code Here

   * Constructs anew XMetaContent component
   */
  public XMetaContent()
  {
    styleStack = new Stack();
    currentStyle = new XStyle();
    currentStyleName = "";
    translator = currentProject.getTranslator();

    fillMethodTable();
  }
View Full Code Here

    clearState = true;
       
    // Style the panel
    XStyleManager sm = currentProject.getStyleManager();
    if ( sm.hasStyle( "dockingPanel" )) {
      XStyle dockingStyle = sm.getStyle( "dockingPanel" );
      if ( dockingStyle instanceof XStyleEx ) {
        XStyleEx exStyle = (XStyleEx)dockingStyle;
        int idx = exStyle.getStyleIndex( "border" );
        if ( idx > 0 ) {
          Color borderColor = dockingStyle.getStyleAsColor( XStyle.COLOR_FORE );
          Object obj = exStyle.getStyleValue( idx );
          if ( obj != null ) {
            String borderStyle = (String)obj.toString();
            if ( "1".equals( borderStyle ))           
              setBorder( new XRoundOnTopBorder( borderColor ));
View Full Code Here


    XTranslator translator = currentProject.getTranslator();
    XStyleManager sm = currentProject.getStyleManager();
    if ( sm.hasStyle( "dockingHeader" )) {
      XStyle xstyle = sm.getStyle( "dockingHeader" );
      colors[ 0 ] = xstyle.getStyleAsColor( XStyle.COLOR_BACK );
      colors[ 1 ] = xstyle.getStyleAsColor( XStyle.COLOR_FORE );

      XStyle xstyleActive = sm.getStyle( "dockingHeader/active" );
      colors[ 2 ] = xstyleActive.getStyleAsColor( XStyle.COLOR_BACK );
      colors[ 3 ] = xstyleActive.getStyleAsColor( XStyle.COLOR_FORE );
    }
   
    // Setup the tooltips
    String[] tooltips = new String[ 3 ];
    tooltips[ 0 ] = ( translator != null ? translator.translate( "Minimize" ) : "Minimize" );
View Full Code Here

//      }
//      else 
        menuBar = (XAppender)Class.forName( basePackageName + XPage.MENUBAR ).newInstance();
      menuBar.setName( page.getName());
     
      XStyle menuStyle = null;
      String menuStyleName = model.getAttribute( "style" );
      Color menuBkColor = null;
      Color menuTextColor = null;
      Font menuFont = null;
      if (( menuStyleName != null ) && ( menuStyleName.length() > 0 )) {
        menuStyle = currentProject.getStyleManager().getStyle( menuStyleName );
        menuBkColor = menuStyle.getStyleAsColor( XStyle.COLOR_BACK );
        menuTextColor = menuStyle.getStyleAsColor( XStyle.COLOR_FORE );
        menuFont = currentProject.getStyleManager().getFont( menuStyleName );
        adapter.setBackground( menuBar, menuBkColor );
        adapter.setForeground( menuBar, menuTextColor );
        adapter.setFont( menuBar, menuFont );
      }
View Full Code Here

TOP

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

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.