Package net.xoetrope.xui.style

Examples of net.xoetrope.xui.style.XStyle


        if (UtilValidate.isEmpty(this.origText)) {
            return;
        }

        StringBuffer newContent = new StringBuffer();
        XStyle style = null;
        if (this.isEnabled) {
            style = enabledStyle;
        } else {
            style = disabledStyle;
        }

        // get the hex color for the current style
        String fcolor = Integer.toHexString(style.getStyleAsColor(XStyle.COLOR_FORE).getRGB() & 0x00ffffff);       
        xbutton.setBackground(style.getStyleAsColor(XStyle.COLOR_BACK));

        // add the # for the HTML color
        if (fcolor.equals("0")) {
            fcolor = "#000000";
        } else {
            fcolor = "#" + fcolor;
        }

        // get the additional styles
        boolean isItalic = false;
        boolean isBold = false;
        if (style.getStyleAsInt(XStyle.FONT_WEIGHT) > 0) {
            isBold = true;
        }
        if (style.getStyleAsInt(XStyle.FONT_ITALIC) > 0) {
            isItalic = true;
        }

        // open with prefix (opening tags)
        newContent.append(prefix.replaceAll("\\$\\{FCOLOR\\}", fcolor));
View Full Code Here


  public void setBorderStyle( Object component, String borderStyle )
  {
    if ( component instanceof JComponent ) {
      JComponent comp = (JComponent) component;
      XStyle style = XProjectManager.getCurrentProject().getStyleManager().getStyle( borderStyle );
      String border = style.getStyleAsString( style.getStyleIndex( XStyleConstants.BORDER_TYPE ));
      if ( border == null )
        border = "none";
     
      Color color = style.getStyleAsColor( XStyle.COLOR_FORE );
      int margint = 0;
      int marginl = 0;
      int marginb = 0;
      int marginr = 0;
      boolean margin = false;
      String sValue = style.getStyleAsString( style.getStyleIndex( XStyleConstants.MARGIN_SIZE ));
      if ( sValue != null ) {
        String[] vals = sValue.toString().split( "," );
        margin = true;
        if ( vals.length == 1 )
          margint = marginl = marginb = marginr = Integer.parseInt( vals[ 0 ] );
        else {
          margint = Integer.parseInt( vals[ 0 ] );
          marginl = Integer.parseInt( vals[ 1 ] );
          marginb = Integer.parseInt( vals[ 2 ] );
          marginr = Integer.parseInt( vals[ 3 ] );
        }
      }
     
      int paddingt = 0;
      int paddingl = 0;
      int paddingb = 0;
      int paddingr = 0;
      boolean padding = false;
      sValue = style.getStyleAsString( style.getStyleIndex( XStyleConstants.PADDING_SIZE ));
      if ( sValue != null ) {
        String[] vals = sValue.toString().split( "," );
        padding = true;
        if ( vals.length == 1 )
          paddingt = paddingl = paddingb = paddingr = Integer.parseInt( vals[ 0 ] );
View Full Code Here

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

    borderColor = style.getStyleAsColor( XStyle.COLOR_FORE );
    drawBorder = true;
  }
View Full Code Here

  private void applyStyle( Graphics g, String styleName )
  {
    if ( styleName == null )
      styleName = "base";

    XStyle style = styleMgr.getStyle( styleName );

    foreColor = style.getStyleAsColor( XStyle.COLOR_FORE );
    if ( foreColor == null )
      foreColor = getForeground();

    backColor = style.getStyleAsColor( XStyle.COLOR_BACK );
    if ( backColor == null )
      backColor = getBackground();

    darkerColor = new Color(
        ( int )( backColor.getRed() * darkerFactor ),
View Full Code Here

  private void applySelectedStyle( Graphics g, String styleName )
  {
    if ( styleName == null )
      styleName = "base";

    XStyle style = styleMgr.getStyle( styleName );

    foreColor = style.getStyleAsColor( XStyle.COLOR_FORE );
    if ( foreColor == null )
      foreColor = getForeground();

    backColor = style.getStyleAsColor( XStyle.COLOR_BACK );
    if ( backColor == null )
      backColor = getBackground();
    darkerColor = backColor;
  }
View Full Code Here

        Graphics g = getGraphics();
        if ( g != null ) {
          // This doesn't properly account for different font sizes in the header but
          // a little more or less height probably won't matter much.
          if ( tableStyle != null ) {
            XStyle style = styleMgr.getStyle( tableStyle );
            font = styleMgr.getFont( style );
            g.setFont( font );
          }
          fontMetrics = g.getFontMetrics();
          fontHeight = fontMetrics.getHeight();
View Full Code Here

          ((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
View Full Code Here

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

    currentProject = XProjectManager.getCurrentProject();
    translator = currentProject.getTranslator();

View Full Code Here

    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();
          multiSplitPane.setDividerSize( padding );
View Full Code Here

    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

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.