当前位置: 首页>>代码示例>>Java>>正文


Java JTabbedPane.BOTTOM属性代码示例

本文整理汇总了Java中javax.swing.JTabbedPane.BOTTOM属性的典型用法代码示例。如果您正苦于以下问题:Java JTabbedPane.BOTTOM属性的具体用法?Java JTabbedPane.BOTTOM怎么用?Java JTabbedPane.BOTTOM使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.swing.JTabbedPane的用法示例。


在下文中一共展示了JTabbedPane.BOTTOM属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dropIndexOfPoint

/**
 * The index at which a tab should be inserted if a drop operation occurs at
 * this point.
 *
 * @param location A point anywhere on the TabbedContainer
 * @return A tab index, or -1
 */
public int dropIndexOfPoint( Point location ) {
    int index = indexAtLocation( location.x, location.y );
    if( index < 0 ) {
        index = getTabCount();
    } else if( index == getTabCount()-1 ) {
        Rectangle rect = getBoundsAt( index );
        if( getTabPlacement() == JTabbedPane.TOP || getTabPlacement() == JTabbedPane.BOTTOM ) {
            if( location.x > rect.x + rect.width/2 )
                index++;
        } else {
            if( location.y > rect.y + rect.height/2 )
                index++;
        }
    }

    return index;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:NBTabbedPane.java

示例2: store

protected boolean store() {
    prefs.putBoolean(WinSysPrefs.EDITOR_CLOSE_ACTIVATES_RECENT, isCloseActivatesMostRecentDocument.isSelected());
    prefs.putBoolean(WinSysPrefs.OPEN_DOCUMENTS_NEXT_TO_ACTIVE_TAB, isNewDocumentOpensNextToActiveTab.isSelected());
    
    boolean needsWinsysRefresh = false;
    needsWinsysRefresh = checkMultiRow.isSelected() != defMultiRow;
    prefs.putBoolean(WinSysPrefs.DOCUMENT_TABS_MULTIROW, checkMultiRow.isSelected());

    int tabPlacement = JTabbedPane.TOP;
    if( radioBottom.isSelected() )
        tabPlacement = JTabbedPane.BOTTOM;
    else if( radioLeft.isSelected() )
        tabPlacement = JTabbedPane.LEFT;
    else if( radioRight.isSelected() )
        tabPlacement = JTabbedPane.RIGHT;
    prefs.putInt( WinSysPrefs.DOCUMENT_TABS_PLACEMENT, tabPlacement );
    needsWinsysRefresh |= tabPlacement != defTabPlacement;

    return needsWinsysRefresh;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:TabsPanel.java

示例3: getSimpleTabsPlacement

/**
 * Defines the tab placement. The possible bundle values are <code>top</code>, <code>bottom</code>, <code>left</code>, <code>right</code>.
 * @return Tab placement when JTabbedPane implementation of Tab Control is
 * being used. The return value is one of <code>JTabbedPane.TOP</code> (default), <code>JTabbedPane.BOTTOM</code>,
 * <code>JTabbedPane.LEFT</code>, <code>JTabbedPane.RIGHT</code>.
 * 
 * @see JTabbedPane#getTabPlacement() 
 * 
 * @since 2.44
 */
public static int getSimpleTabsPlacement() {
    int result = JTabbedPane.TOP;
    try {
        String resValue = NbBundle.getMessage(Switches.class, "WinSys.TabControl.SimpleTabs.Placement" ); //NOI18N
        if( "bottom".equals( resValue ) )
            result = JTabbedPane.BOTTOM;
        else if( "right".equals( resValue ) )
            result = JTabbedPane.RIGHT;
        else if( "left".equals( resValue ) )
            result = JTabbedPane.LEFT;
    } catch( MissingResourceException mrE ) {
        //ignore
    }
    return result;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:Switches.java

示例4: store

boolean store() {
    boolean changed = false;
    int placement = JTabbedPane.TOP;
    if( radioPlacementBottom.isSelected() ) {
        placement = JTabbedPane.BOTTOM;
    } else if( radioPlacementLeft.isSelected() ) {
        placement = JTabbedPane.LEFT;
    } else if( radioPlacementRight.isSelected() ) {
        placement = JTabbedPane.RIGHT;
    }
    changed |= settings.setTabsLocation( placement );
    changed |= settings.setShowFullPath( checkShowFullPath.isSelected() );
    changed |= settings.setSameProjectSameColor( checkProjectColors.isSelected() );

    int rowCount = 1;
    if( checkMultiRow.isSelected() && radioRowCount.isSelected() )
        rowCount = ((Number)spinRowCount.getValue()).intValue();
    changed |= settings.setRowCount( rowCount );
    changed |= settings.setTabRowPerProject( radioRowPerProject.isSelected() && checkMultiRow.isSelected() );

    changed |= settings.setShowFolderName( checkShowFolderName.isSelected() );
    changed |= settings.setSortDocumentListByProject( checkSortDocumentList.isSelected() );

    return changed;

}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:InnerTabsPanel.java

示例5: load

protected void load() {
    isCloseActivatesMostRecentDocument.setSelected(prefs.getBoolean(WinSysPrefs.EDITOR_CLOSE_ACTIVATES_RECENT, true));
    isNewDocumentOpensNextToActiveTab.setSelected(prefs.getBoolean(WinSysPrefs.OPEN_DOCUMENTS_NEXT_TO_ACTIVE_TAB, false));

    defMultiRow = prefs.getBoolean( WinSysPrefs.DOCUMENT_TABS_MULTIROW, false );
    checkMultiRow.setSelected( defMultiRow );
    defTabPlacement = prefs.getInt( WinSysPrefs.DOCUMENT_TABS_PLACEMENT, JTabbedPane.TOP );
    switch( defTabPlacement ) {
        case JTabbedPane.BOTTOM:
            radioBottom.setSelected( true );
            break;
        case JTabbedPane.LEFT:
            radioLeft.setSelected( true );
            break;
        case JTabbedPane.RIGHT:
            radioRight.setSelected( true );
            break;
        default:
            radioTop.setSelected( true );
    }
    
    if( isAquaLaF ) {
        checkMultiRow.setSelected(false);
        checkMultiRow.setEnabled(false);
        radioLeft.setEnabled(false);
        radioRight.setEnabled(false);
        if( radioLeft.isSelected() || radioRight.isSelected() ) {
            radioTop.setSelected(true);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:TabsPanel.java

示例6: fireChanged

private void fireChanged() {
    boolean isChanged = false;
    if (checkShowFolderName.isSelected() != settings.isShowFolderName()
            || checkShowFullPath.isSelected() != settings.isShowFullPath()
            || checkProjectColors.isSelected() != settings.isSameProjectSameColor()
            || checkSortDocumentList.isSelected() != settings.isSortDocumentListByProject()) {
        isChanged = true;
    }
    
    int rowCount = settings.getRowCount();
    if (checkMultiRow.isSelected() && radioRowCount.isSelected()) {
        rowCount = ((Number) spinRowCount.getValue()).intValue();
    }
    if (checkMultiRow.isSelected() != (rowCount > 1 || settings.isTabRowPerProject())) {
        isChanged = true;
    }
    if (rowCount != settings.getRowCount()) {
        isChanged = true;
    }
    if (radioRowPerProject.isSelected() != settings.isTabRowPerProject()) {
        isChanged = true;
    }
    
    if(radioPlacementBottom.isSelected() && settings.getTabsLocation() != JTabbedPane.BOTTOM
            || radioPlacementLeft.isSelected() && settings.getTabsLocation() != JTabbedPane.LEFT
            || radioPlacementRight.isSelected() && settings.getTabsLocation() != JTabbedPane.RIGHT
            || radioPlacementTop.isSelected() && settings.getTabsLocation() != JTabbedPane.TOP) {
        isChanged = true;
    }
    controller.changed(null, isChanged);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:InnerTabsPanel.java

示例7: load

void load() {
    ProjectSupport projectSupport = ProjectSupport.getDefault();
    switch( settings.getTabsLocation() ) {
        case JTabbedPane.LEFT:
            radioPlacementLeft.setSelected( true );
            break;
        case JTabbedPane.RIGHT:
            radioPlacementRight.setSelected( true );
            break;
        case JTabbedPane.BOTTOM:
            radioPlacementBottom.setSelected( true );
            break;
        default:
            radioPlacementTop.setSelected( true );
    }
    checkShowFolderName.setSelected( settings.isShowFolderName() );
    checkShowFullPath.setSelected( settings.isShowFullPath() );
    checkProjectColors.setSelected( settings.isSameProjectSameColor() );
    checkSortDocumentList.setSelected( settings.isSortDocumentListByProject() );
    int rowCount = settings.getRowCount();
    checkMultiRow.setSelected( rowCount > 1 || settings.isTabRowPerProject() );
    if( rowCount > 1 )
        spinRowCount.getModel().setValue( Integer.valueOf( rowCount ) );
    radioRowPerProject.setSelected( settings.isTabRowPerProject() );
    radioRowCount.setSelected( rowCount > 1 );

    radioRowPerProject.setVisible( projectSupport.isEnabled() );
    checkProjectColors.setVisible( projectSupport.isEnabled() );
    checkSortDocumentList.setVisible( projectSupport.isEnabled() );

    enableControls();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:32,代码来源:InnerTabsPanel.java

示例8: createTabDisplayer

@Override
public TabDisplayer createTabDisplayer( TabDataModel tabModel, int orientation ) {
    Settings settings = Settings.getDefault();
    boolean multiRow = settings.getRowCount() > 1 || settings.isTabRowPerProject();
    if( multiRow && (orientation == JTabbedPane.TOP || orientation == JTabbedPane.BOTTOM) ) {
        if( settings.isTabRowPerProject() ) {
            return new RowPerProjectTabDisplayer( tabModel, orientation );
        }
        return new MultiRowTabDisplayer( tabModel, orientation );
    }
    return new SimpleTabDisplayer( tabModel, orientation );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:TabDisplayerFactory.java

示例9: TabContainer

TabContainer( TabbedImpl tabbedImpl, TabDisplayer tabDisplayer, int orientation ) {
    super( new BorderLayout(0, 0) );
    this.tabbedImpl = tabbedImpl;
    this.displayer = tabDisplayer;
    tcPanel = new JPanel( layout );
    add( tcPanel, BorderLayout.CENTER );
    tabbedImpl.getSelectionModel().addChangeListener( this );
    String lafId = UIManager.getLookAndFeel().getID();
    if( "Nimbus".equals( lafId ) ) {
        setBorder( new MatteBorder(1, 1, 1, 1, UIManager.getColor("nimbusBorder"))); //NOI18N
    } else if( "Aqua".equals( lafId ) ) {
        setBorder( BorderFactory.createEmptyBorder() );
    } else {
        setBorder( UIManager.getBorder( "Nb.ScrollPane.border" ) ); //NOI18N
    }
    switch( orientation ) {
        case JTabbedPane.TOP:
            add( displayer, BorderLayout.NORTH );
            break;
        case JTabbedPane.LEFT:
            add( displayer, BorderLayout.WEST );
            break;
        case JTabbedPane.RIGHT:
            add( displayer, BorderLayout.EAST );
            break;
        case JTabbedPane.BOTTOM:
            add( displayer, BorderLayout.SOUTH );
            break;
        default:
            throw new IllegalArgumentException( "Invalid orientation: " + orientation ); //NOI18N
    }
    stateChanged( null );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:TabContainer.java

示例10: initOutputPane

private void initOutputPane()
{
    JTabbedPane output = new JTabbedPane(JTabbedPane.BOTTOM);
    JConsole console = new JConsole();

    console.setBackground(Color.WHITE);
    _model = new DemoModel(console);
    _console = new JConsole();

    output.addTab("Console", _console);
    output.setBackground(Color.WHITE);
    output.setPreferredSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));
    output.addTab("Interpreter", console);
    try
    {

        //
        _helpTextArea.setText(_model.help());
    }
    catch (IOException x)
    {
        exceptionThrown(x);
    }

    //
    _container.add(output);
}
 
开发者ID:JetBrains,项目名称:intellij-deps-ini4j,代码行数:27,代码来源:Demo.java

示例11: TabTable

public TabTable( TabDataModel tabModel, int tabsLocation ) {
    this( TabTableModel.create(tabModel, tabsLocation),
            tabsLocation == JTabbedPane.TOP || tabsLocation == JTabbedPane.BOTTOM ? JTabbedPane.HORIZONTAL : JTabbedPane.VERTICAL );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:TabTable.java


注:本文中的javax.swing.JTabbedPane.BOTTOM属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。