Examples of XDockable


Examples of net.xoetrope.swing.docking.XDockable

   */
  public void showExclusive( Object comp, boolean state )
  {
    exclusiveView = state;
    setDecorationsVisible( !state );
    XDockable dockable = findDockable( comp );
    if ( dockable != null ) {
      dockable.header.zoomPanel();
     
      // Hide the header panel
      dockable.header.getParent().setVisible( !state );
View Full Code Here

Examples of net.xoetrope.swing.docking.XDockable

    MultiSplitLayout multiSplitLayout = multiSplitPane.getMultiSplitLayout();
    int numChildren = multiSplitPane.getComponentCount();
    for ( int i = 0; i < numChildren; i++ ) {
      Component comp = multiSplitPane.getComponent( i );
      if ( comp instanceof XDockableFrame ) {
        XDockable dockable = ((XDockableFrame)comp).findDockable( content );
        if ( dockable != null )
          return dockable;
      }
    }
   
    XDockable dockable = cardPanel.getDockable();
    if ( dockable != null ) {
      if (( dockable.content == content ) || ( dockable.dockedContainer == content ) || ( dockable.header == content ))
        return dockable;
    }
   
View Full Code Here

Examples of net.xoetrope.swing.docking.XDockable

      s = (String)nextAttributes.get( "icon" );
      if ( s != null )
        iconName = s;
    }
    XDockable dockable = findDockable( comp );
    if ( dockable == null )
      dockable = new XDockable( getDockingApp().getSidebar( sidebar != null ? sidebar : getName()),
                                title != null ? currentProject.getTranslator().translate( title ) : getName());
    dockables.add( dockable );
    dockable.content = (Container)comp;
   
    boolean doReplace = true;
   
    dockable.canClose = canClose;
    dockable.canMinimize = canMinimize;
    dockable.canDock = canDock;
    dockable.canDrag = canDrag;
    dockable.canZoom = canZoom;
    dockable.hasDockingTitle = hasDockingTitle;
    if ( nextAttributes != null ) {
      String s = (String)nextAttributes.get( "canMinimize" );
      if (( s != null ) && ( s.length() > 0 ))
        dockable.canMinimize = "true".equals( s );
     
      s = (String)nextAttributes.get( "canClose" );
      if (( s != null ) && ( s.length() > 0 ))
        dockable.canClose = "true".equals( s );
     
      s = (String)nextAttributes.get( "canDock" );
      if (( s != null ) && ( s.length() > 0 ))
        dockable.canDock = "true".equals( s );
     
      s = (String)nextAttributes.get( "canDrag" );
      if (( s != null ) && ( s.length() > 0 ))
        dockable.canDrag = "true".equals( s );
     
      s = (String)nextAttributes.get( "canZoom" );
      if (( s != null ) && ( s.length() > 0 ))
        dockable.canZoom = "true".equals( s );
     
      s = (String)nextAttributes.get( "hasDockingTitle" );
      if (( s != null ) && ( s.length() > 0 ))
        dockable.hasDockingTitle = "true".equals( s );

      s = (String)nextAttributes.get( "replace" );
      if (( s != null ) && ( s.length() > 0 ))
        doReplace = "true".equals( s );
     
      s = (String)nextAttributes.get( "state" );
      if ( s != null ) {
        if ( s.equals( "minimized" )) {
          minimized = true;
          maximized = false;
        }
        else if ( s.equals( "maximized" )) {
          maximized = true;
          minimized = false;
        }
      }
    }

    if (( iconName != null ) && ( iconName.length() > 0 ))
      dockable.icon = (ImageIcon)currentProject.getIcon( iconName );

    // Setup the coloring
    Color[] colors = new Color[ 5 ];
    colors[ 0 ] = SystemColor.control.brighter(); // headerBkColor
    colors[ 1 ] = SystemColor.controlText; // headerTextColor
    colors[ 2 ] = Color.orange; // activeColor - the stripe under the active component
    colors[ 3 ] = colors[ 2 ];// activeTextColor
    colors[ 4 ] = Color.red;// pressedTextColor


    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" );
    tooltips[ 1 ] = ( translator != null ? translator.translate( "Zoom/Restore" ) : "Zoom/Restore" );
    tooltips[ 2 ] = ( translator != null ? translator.translate( "Close" ) : "Close" );
   
    super.addDockable( dockable, colors, tooltips );
    if ( doReplace ) {
      if ( contentPane.getComponentCount() > ) {
        XDockable docked = findDockable( contentPane.getComponent( 0 ));
        if (( docked != null ) && ( docked != dockable ))
          super.removeDockable( docked, false );
        else if ( minimized )
          dockable.dockedContainer.setVisible( true );
      }
    }

    final XDockable thisDockable = dockable;
    SwingUtilities.invokeLater( new Runnable() {
      public void run()
      {
        if ( minimized ) {
          thisDockable.dockedContainer.removeDockable( thisDockable, true );
View Full Code Here

Examples of net.xoetrope.swing.docking.XDockable

   */
  public XDockable findDockable( Object c )
  {
    int numDockables = dockables.size();
    for ( int i = 0; i < numDockables; i++ ) {
      XDockable dockable = (XDockable)dockables.get( i );
      if (( dockable.content == c ) || ( dockable.dockedContainer == c ) || ( dockable.header == c ))
        return dockable;
    }
   
    return null;
View Full Code Here

Examples of net.xoetrope.swing.docking.XDockable

   * Zoom in in a panel or dockable
   * @param c the docked component, header or panel.
   */
  public void zoomDockable( Object c )
  {
    XDockable d = findDockable( c );
    d.header.zoomPanel();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.