Example usage for javax.swing SwingConstants TOP

List of usage examples for javax.swing SwingConstants TOP

Introduction

In this page you can find the example usage for javax.swing SwingConstants TOP.

Prototype

int TOP

To view the source code for javax.swing SwingConstants TOP.

Click Source Link

Document

Box-orientation constant used to specify the top of a box.

Usage

From source file:org.nuxeo.launcher.sync.NuxeoSyncFrame.java

@Override
protected JComponent buildTabbedPanel() {
    // do not call super, hiding other tabbed panel (log and summary tab)
    tabbedPanel = new JTabbedPane(SwingConstants.TOP);
    tabbedPanel.addTab("Synchronization", buildSyncPanel());
    return tabbedPanel;
}

From source file:org.revager.gui.findings_list.FindingsListFrame.java

private void createBody() {
    SwingUtilities.invokeLater(() -> {
        try {// ww w  .  j a va2  s.  co  m
            attPanel.removeAll();
            createAttPanel();
            attPanel.validate();

            bottomOrgPanel.removeAll();
            createBottomOrgPanel();
            bottomOrgPanel.validate();

            tabGenImp.removeAll();
            createImpPanel();
            tabGenImp.validate();

            tabPanelCommAndRec.removeAll();
            createCommAndRatePanel();
            tabPanelCommAndRec.validate();
        } catch (Exception exc) {
            // Workaround for a threading problem
            exc.printStackTrace();

            JOptionPane.showMessageDialog(UI.getInstance().getProtocolFrame(),
                    GUITools.getMessagePane(translate("Severe problem occurred! RevAger has to be restarted.")),
                    translate("Problem occurred"), JOptionPane.ERROR_MESSAGE);

            ExitAction exitAction = ((ExitAction) ActionRegistry.getInstance().get(ExitAction.class.getName()));

            exitAction.setRestartAgain(true);
            exitAction.actionPerformed(null);
        }
    });

    SwingUtilities.invokeLater(() -> {
        tabPanelFindings = new FindingsTab(currentProt);
        tabbedPane.removeAll();
        tabbedPane.removeChangeListener(tabChangeListener);
        tabbedPane.setTabPlacement(SwingConstants.TOP);
        tabbedPane.add(translate("Organizational"), tabPanelOrg);
        tabbedPane.add(translate("Impression"), tabGenImp);
        tabbedPane.add(translate("Findings"), tabPanelFindings);
        tabbedPane.add(translate("Comments & Recommendation"), tabPanelCommAndRec);
        tabbedPane.addChangeListener(tabChangeListener);

        add(tabbedPane);
        bodyCreated = true;
    });
}

From source file:org.spoutcraft.launcher.skin.components.BackgroundImage.java

public BackgroundImage(int width, int height) {
    setVerticalAlignment(SwingConstants.CENTER);
    setHorizontalAlignment(SwingConstants.CENTER);
    setBounds(0, 0, width, height);/*from  w  w w .j a  v a  2s .c o m*/

    setIcon(new ImageIcon(getBackgroundImage().getScaledInstance(width, height, Image.SCALE_SMOOTH)));
    setVerticalAlignment(SwingConstants.TOP);
    setHorizontalAlignment(SwingConstants.LEFT);
}

From source file:pcgen.core.SettingsHandler.java

public static Dimension getOptionsFromProperties(final PlayerCharacter aPC) {
    Dimension d = new Dimension(0, 0);

    final String tempBrowserPath = getPCGenOption("browserPath", ""); //$NON-NLS-1$ //$NON-NLS-2$

    if (!"".equals(tempBrowserPath)) //$NON-NLS-1$
    {//from w  ww.jav a2 s .  c om
        setBrowserPath(tempBrowserPath);
    } else {
        setBrowserPath(null);
    }

    setLeftUpperCorner(new Point(getPCGenOption("windowLeftUpperCorner.X", -1.0).intValue(), //$NON-NLS-1$
            getPCGenOption("windowLeftUpperCorner.Y", -1.0).intValue())); //$NON-NLS-1$

    setWindowState(getPCGenOption("windowState", Frame.NORMAL)); //$NON-NLS-1$

    Double dw = getPCGenOption("windowWidth", 0.0); //$NON-NLS-1$
    Double dh = getPCGenOption("windowHeight", 0.0); //$NON-NLS-1$

    if (!CoreUtility.doublesEqual(dw.doubleValue(), 0.0) && !CoreUtility.doublesEqual(dh.doubleValue(), 0.0)) {
        final int width = Integer.parseInt(
                dw.toString().substring(0, Math.min(dw.toString().length(), dw.toString().lastIndexOf('.'))));
        final int height = Integer.parseInt(
                dh.toString().substring(0, Math.min(dh.toString().length(), dh.toString().lastIndexOf('.'))));
        d = new Dimension(width, height);
    }

    setCustomizerLeftUpperCorner(
            new Point(getPCGenOption("customizer.windowLeftUpperCorner.X", -1.0).intValue(), //$NON-NLS-1$
                    getPCGenOption("customizer.windowLeftUpperCorner.Y", -1.0).intValue())); //$NON-NLS-1$
    dw = getPCGenOption("customizer.windowWidth", 0.0); //$NON-NLS-1$
    dh = getPCGenOption("customizer.windowHeight", 0.0); //$NON-NLS-1$

    if (!CoreUtility.doublesEqual(dw.doubleValue(), 0.0) && !CoreUtility.doublesEqual(dh.doubleValue(), 0.0)) {
        setCustomizerDimension(new Dimension(dw.intValue(), dh.intValue()));
    }

    setKitSelectorLeftUpperCorner(
            new Point(getPCGenOption("kitSelector.windowLeftUpperCorner.X", -1.0).intValue(), //$NON-NLS-1$
                    getPCGenOption("kitSelector.windowLeftUpperCorner.Y", -1.0).intValue())); //$NON-NLS-1$
    dw = getPCGenOption("kitSelector.windowWidth", 0.0); //$NON-NLS-1$
    dh = getPCGenOption("kitSelector.windowHeight", 0.0); //$NON-NLS-1$

    if (!CoreUtility.doublesEqual(dw.doubleValue(), 0.0) && !CoreUtility.doublesEqual(dh.doubleValue(), 0.0)) {
        setKitSelectorDimension(new Dimension(dw.intValue(), dh.intValue()));
    }

    //
    // Read in the buy/sell percentages for the gear tab
    // If not in the .ini file and ignoreCost is set, then use 0%
    // Otherwise set buy to 100% and sell to %50
    //
    int buyRate = getPCGenOption("GearTab.buyRate", -1); //$NON-NLS-1$
    int sellRate = getPCGenOption("GearTab.sellRate", -1); //$NON-NLS-1$

    if ((buyRate < 0) || (sellRate < 0)) {
        if (getPCGenOption("GearTab.ignoreCost", false)) //$NON-NLS-1$
        {
            buyRate = 0;
            sellRate = 0;
        } else {
            buyRate = 100;
            sellRate = 50;
        }
    }

    Globals.initCustColumnWidth(CoreUtility.split(getOptions().getProperty("pcgen.options.custColumnWidth", ""), //$NON-NLS-1$//$NON-NLS-2$
            ','));

    loadURLs = getPCGenOption("loadURLs", false); //$NON-NLS-1$

    Globals.setSourceDisplay(
            SourceFormat.values()[getPCGenOption("sourceDisplay", SourceFormat.LONG.ordinal())]); //$NON-NLS-1$

    setAlwaysOverwrite(getPCGenOption("alwaysOverwrite", false)); //$NON-NLS-1$
    setAutoFeatsRefundable(getPCGenOption("autoFeatsRefundable", false)); //$NON-NLS-1$
    setAutogenExoticMaterial(getPCGenOption("autoGenerateExoticMaterial", false)); //$NON-NLS-1$
    setAutogenMagic(getPCGenOption("autoGenerateMagic", false)); //$NON-NLS-1$
    setAutogenMasterwork(getPCGenOption("autoGenerateMasterwork", false)); //$NON-NLS-1$
    setAutogenRacial(getPCGenOption("autoGenerateRacial", false)); //$NON-NLS-1$
    setChaTabPlacement(getOptionTabPlacement("chaTabPlacement", SwingConstants.TOP)); //$NON-NLS-1$
    setCreatePcgBackup(getPCGenOption("createPcgBackup", true));
    setCustomizerSplit1(getPCGenOption("customizer.split1", -1)); //$NON-NLS-1$
    setCustomizerSplit2(getPCGenOption("customizer.split2", -1)); //$NON-NLS-1$
    setDefaultOSType(getPCGenOption("defaultOSType", null)); //$NON-NLS-1$
    setEnforceSpendingBeforeLevelUp(getPCGenOption("enforceSpendingBeforeLevelUp", false)); //$NON-NLS-1$
    setGearTab_AllowDebt(getPCGenOption("GearTab.allowDebt", false)); //$NON-NLS-1$
    setGearTab_AutoResize(getPCGenOption("GearTab.autoResize", false)); //$NON-NLS-1$
    setGearTab_BuyRate(buyRate);
    setGearTab_IgnoreCost(getPCGenOption("GearTab.ignoreCost", false)); //$NON-NLS-1$
    setGearTab_SellRate(sellRate);
    setGrimHPMode(getPCGenOption("grimHPMode", false)); //$NON-NLS-1$
    setGrittyACMode(getPCGenOption("grittyACMode", false)); //$NON-NLS-1$
    setGUIUsesOutputNameEquipment(getPCGenOption("GUIUsesOutputNameEquipment", false)); //$NON-NLS-1$
    setGUIUsesOutputNameSpells(getPCGenOption("GUIUsesOutputNameSpells", false)); //$NON-NLS-1$
    setHideMonsterClasses(getPCGenOption("hideMonsterClasses", false)); //$NON-NLS-1$
    setHPMaxAtFirstLevel(getPCGenOption("hpMaxAtFirstLevel", true)); //$NON-NLS-1$
    setHPMaxAtFirstClassLevel(getPCGenOption("hpMaxAtFirstClassLevel", false)); //$NON-NLS-1$
    setHPMaxAtFirstPCClassLevelOnly(getPCGenOption("hpMaxAtFirstPCClassLevelOnly", false)); //$NON-NLS-1$
    setHPPercent(getPCGenOption("hpPercent", 100)); //$NON-NLS-1$
    setHPRollMethod(getPCGenOption("hpRollMethod", Constants.HP_STANDARD)); //$NON-NLS-1$
    setIgnoreMonsterHDCap(getPCGenOption("ignoreMonsterHDCap", false)); //$NON-NLS-1$
    setInvalidDmgText(getPCGenOption("invalidDmgText", //$NON-NLS-1$
            LanguageBundle.getString("SettingsHandler.114"))); //$NON-NLS-1$
    setInvalidToHitText(getPCGenOption("invalidToHitText", //$NON-NLS-1$
            LanguageBundle.getString("SettingsHandler.114"))); //$NON-NLS-1$
    setLastTipShown(getPCGenOption("lastTipOfTheDayTipShown", -1)); //$NON-NLS-1$
    setLookAndFeel(getPCGenOption("looknFeel", 1)); //$NON-NLS-1$
    setMaxPotionSpellLevel(getPCGenOption("maxPotionSpellLevel", 3)); //$NON-NLS-1$
    setMaxWandSpellLevel(getPCGenOption("maxWandSpellLevel", 4)); //$NON-NLS-1$
    setMetamagicAllowedInEqBuilder(getPCGenOption("allowMetamagicInCustomizer", false)); //$NON-NLS-1$
    setPccFilesLocation(new File(expandRelativePath(getPCGenOption("pccFilesLocation", //$NON-NLS-1$
            System.getProperty("user.dir") + File.separator + "data")))); //$NON-NLS-1$ //$NON-NLS-2$
    setPcgenOutputSheetDir(
            new File(expandRelativePath(getOptions().getProperty("pcgen.files.pcgenOutputSheetDir", //$NON-NLS-1$
                    System.getProperty("user.dir") + File.separator + "outputsheets")))); //$NON-NLS-1$ //$NON-NLS-2$
    setPcgenPreviewDir(new File(expandRelativePath(getOptions().getProperty("pcgen.files.pcgenPreviewDir", //$NON-NLS-1$
            System.getProperty("user.dir") + File.separator + "preview")))); //$NON-NLS-1$ //$NON-NLS-2$
    setGmgenPluginDir(new File(expandRelativePath(getOptions().getProperty("gmgen.files.gmgenPluginDir", //$NON-NLS-1$
            System.getProperty("user.dir") + File.separator + "plugins")))); //$NON-NLS-1$ //$NON-NLS-2$
    setBackupPcgPath(
            new File(expandRelativePath(getOptions().getProperty("pcgen.files.characters.backup", "")))); //$NON-NLS-1$
    setPortraitsPath(new File(expandRelativePath(getOptions().getProperty("pcgen.files.portraits", //$NON-NLS-1$
            Globals.getDefaultPcgPath()))));
    setPostExportCommandStandard(getPCGenOption("postExportCommandStandard", "")); //$NON-NLS-1$ //$NON-NLS-2$
    setPostExportCommandPDF(getPCGenOption("postExportCommandPDF", "")); //$NON-NLS-1$ //$NON-NLS-2$
    setPrereqFailColor(getPCGenOption("prereqFailColor", Color.red.getRGB())); //$NON-NLS-1$
    setPrereqQualifyColor(getPCGenOption("prereqQualifyColor", SystemColor.text.getRGB())); //$NON-NLS-1$
    setPreviewTabShown(getPCGenOption("previewTabShown", true)); //$NON-NLS-1$
    setROG(getPCGenOption("isROG", false)); //$NON-NLS-1$
    setSaveCustomInLst(getPCGenOption("saveCustomInLst", false)); //$NON-NLS-1$
    setSaveOutputSheetWithPC(getPCGenOption("saveOutputSheetWithPC", false)); //$NON-NLS-1$
    setPrintSpellsWithPC(getPCGenOption("printSpellsWithPC", true)); //$NON-NLS-1$
    setSelectedSpellSheet(
            expandRelativePath(getOptions().getProperty("pcgen.files.selectedSpellOutputSheet", ""))); //$NON-NLS-1$ //$NON-NLS-2$
    setSelectedCharacterHTMLOutputSheet(
            expandRelativePath(getOptions().getProperty("pcgen.files.selectedCharacterHTMLOutputSheet", //$NON-NLS-1$
                    "")), //$NON-NLS-1$
            aPC);
    setSelectedCharacterPDFOutputSheet(
            expandRelativePath(getOptions().getProperty("pcgen.files.selectedCharacterPDFOutputSheet", //$NON-NLS-1$
                    "")), //$NON-NLS-1$
            aPC);
    setSelectedEqSetTemplate(
            expandRelativePath(getOptions().getProperty("pcgen.files.selectedEqSetTemplate", ""))); //$NON-NLS-1$ //$NON-NLS-2$
    setSelectedPartyHTMLOutputSheet(
            expandRelativePath(getOptions().getProperty("pcgen.files.selectedPartyHTMLOutputSheet", //$NON-NLS-1$
                    ""))); //$NON-NLS-1$
    setSelectedPartyPDFOutputSheet(
            expandRelativePath(getOptions().getProperty("pcgen.files.selectedPartyPDFOutputSheet", //$NON-NLS-1$
                    ""))); //$NON-NLS-1$
    setShowFeatDialogAtLevelUp(getPCGenOption("showFeatDialogAtLevelUp", true)); //$NON-NLS-1$
    setShowHPDialogAtLevelUp(getPCGenOption("showHPDialogAtLevelUp", true)); //$NON-NLS-1$
    setShowImagePreview(getPCGenOption("showImagePreview", true)); //$NON-NLS-1$
    setShowSingleBoxPerBundle(getPCGenOption("showSingleBoxPerBundle", false)); //$NON-NLS-1$
    setOutputDeprecationMessages(getPCGenOption("outputDeprecationMessages", true));
    setInputUnconstructedMessages(getPCGenOption("inputUnconstructedMessages", false));
    setShowStatDialogAtLevelUp(getPCGenOption("showStatDialogAtLevelUp", true)); //$NON-NLS-1$
    setShowTipOfTheDay(getPCGenOption("showTipOfTheDay", true)); //$NON-NLS-1$
    setShowToolBar(getPCGenOption("showToolBar", true)); //$NON-NLS-1$
    setShowSkillModifier(getPCGenOption("showSkillModifier", true)); //$NON-NLS-1$
    setShowSkillRanks(getPCGenOption("showSkillRanks", true)); //$NON-NLS-1$
    setShowWarningAtFirstLevelUp(getPCGenOption("showWarningAtFirstLevelUp", true)); //$NON-NLS-1$
    setSkinLFThemePack(getPCGenOption("skinLFThemePack", "")); //$NON-NLS-1$ //$NON-NLS-2$
    setSpellMarketPriceAdjusted(getPCGenOption("spellMarketPriceAdjusted", false)); //$NON-NLS-1$
    setTabPlacement(getOptionTabPlacement("tabPlacement", SwingConstants.BOTTOM)); //$NON-NLS-1$
    setUseHigherLevelSlotsDefault(getPCGenOption("useHigherLevelSlotsDefault", false)); //$NON-NLS-1$
    setUseWaitCursor(getPCGenOption("useWaitCursor", true)); //$NON-NLS-1$
    setWantToLoadMasterworkAndMagic(getPCGenOption("loadMasterworkAndMagicFromLst", false)); //$NON-NLS-1$
    setWeaponProfPrintout(getPCGenOption("weaponProfPrintout", Constants.DEFAULT_PRINTOUT_WEAPONPROF));

    // Load up all the RuleCheck stuff from the options.ini file
    // It's stored as:
    //   pcgen.options.rulechecks=aKey:Y|bKey:N|cKey:Y
    parseRuleChecksFromOptions(getPCGenOption("ruleChecks", "")); //$NON-NLS-1$ //$NON-NLS-2$

    return d;
}

From source file:pcgen.core.SettingsHandler.java

private static int getOptionTabPlacement(final String optionName, final int defaultValue) {
    final String aString = getPCGenOption(optionName, convertTabPlacementToString(defaultValue));
    int iVal;/*from  w w w  . j a  v  a2s  . c om*/

    try {
        iVal = Integer.parseInt(aString);

        switch (iVal) {
        case SwingConstants.TOP:
        case SwingConstants.LEFT:
        case SwingConstants.BOTTOM:
        case SwingConstants.RIGHT:
            break;

        default:
            iVal = defaultValue;

            break;
        }
    } catch (NumberFormatException exc) {
        if ("TOP".equals(aString)) //$NON-NLS-1$
        {
            iVal = SwingConstants.TOP;
        } else if ("LEFT".equals(aString)) //$NON-NLS-1$
        {
            iVal = SwingConstants.LEFT;
        } else if ("BOTTOM".equals(aString)) //$NON-NLS-1$
        {
            iVal = SwingConstants.BOTTOM;
        } else if ("RIGHT".equals(aString)) //$NON-NLS-1$
        {
            iVal = SwingConstants.RIGHT;
        } else {
            iVal = defaultValue;
        }
    }

    return iVal;
}

From source file:pcgen.core.SettingsHandler.java

private static String convertTabPlacementToString(final int placement) {
    switch (placement) {
    case SwingConstants.BOTTOM:
        return "BOTTOM"; //$NON-NLS-1$

    case SwingConstants.LEFT:
        return "LEFT"; //$NON-NLS-1$

    case SwingConstants.RIGHT:
        return "RIGHT"; //$NON-NLS-1$

    case SwingConstants.TOP:
    default:/*  w  ww  . j  a va2 s.c o m*/
        return "TOP"; //$NON-NLS-1$
    }
}

From source file:rita.ui.component.DialogSelectEnemies.java

/**
 * Initialize the contents of the frame.
 * /*from   w w w. j  ava  2 s.  c o  m*/
 * @throws NoEnemiesException
 */
private void initialize() throws NoEnemiesException {
    this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    this.getContentPane().setLayout(new BorderLayout(6, 6));
    this.setTitle(Language.get("selectEnemies"));
    randomMode = new JCheckBox(Language.get("robotsBattleMode.random"));
    randomMode.setSelected(true);
    randomMode.addActionListener(new SelectUnselectPositionAction());

    icon = new ImageIcon(DialogSelectEnemies.class.getResource("/images/icons/target.jpg"));

    JPanel panelRobots = new JPanel();
    panelRobots.setBorder(new EmptyBorder(0, 12, 12, 0));
    panelRobots.setLayout(new BorderLayout(0, 0));

    JPanel panelSelectAllNone = new JPanel();
    panelSelectAllNone.setBorder(new EmptyBorder(0, 12, 0, 12));
    panelRobots.add(panelSelectAllNone, BorderLayout.EAST);
    this.getContentPane().add(panelRobots, BorderLayout.CENTER);

    GridBagLayout gbl_panelSelectAllNone = new GridBagLayout();
    gbl_panelSelectAllNone.columnWidths = new int[] { 0, 0 };
    gbl_panelSelectAllNone.rowHeights = new int[] { 0, 0, 8 };
    gbl_panelSelectAllNone.columnWeights = new double[] { 0.0, Double.MIN_VALUE };
    gbl_panelSelectAllNone.rowWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
    panelSelectAllNone.setLayout(gbl_panelSelectAllNone);

    JButton btnSelectAll = new JButton(Language.get("selectAllEnemies"));
    GridBagConstraints gbc_btnSelectAll = new GridBagConstraints();
    gbc_btnSelectAll.fill = GridBagConstraints.HORIZONTAL;
    gbc_btnSelectAll.insets = new Insets(0, 0, 5, 0);
    gbc_btnSelectAll.gridx = 0;
    gbc_btnSelectAll.gridy = 0;
    panelSelectAllNone.add(btnSelectAll, gbc_btnSelectAll);

    JButton btnSelectNone = new JButton(Language.get("selectNoEnemies"));
    GridBagConstraints gbc_btnSelectNone = new GridBagConstraints();
    gbc_btnSelectNone.fill = GridBagConstraints.HORIZONTAL;
    gbc_btnSelectNone.gridx = 0;
    gbc_btnSelectNone.gridy = 1;
    panelSelectAllNone.add(btnSelectNone, gbc_btnSelectNone);

    /*
     * btnInitialPositionsConfig = new
     * JButton(Language.get("selectRobotsInitialPositions"));
     * GridBagConstraints gbc_btnInitialPositionsConfig = new
     * GridBagConstraints(); gbc_btnSelectNone.fill =
     * GridBagConstraints.HORIZONTAL; gbc_btnSelectNone.gridx = 0;
     * gbc_btnSelectNone.gridy = 1;
     * panelSelectAllNone.add(btnInitialPositionsConfig,
     * gbc_btnInitialPositionsConfig);
     * btnInitialPositionsConfig.addActionListener(new ActionListener() {
     * public void actionPerformed(ActionEvent evt) {
     * selectRobotsInitialPositions(); } });
     */

    JLabel label = new JLabel(String.format(Language.get("youtRobotAgainst"), HelperEditor.currentRobotName));
    label.setBorder(new EmptyBorder(12, 12, 0, 12));
    label.setIcon(new ImageIcon(DialogSelectEnemies.class.getResource("/images/icons/compite2.png")));
    label.setVerticalAlignment(SwingConstants.TOP);
    label.setFont(label.getFont().deriveFont(Font.BOLD, 14));

    panelSelectRobots = new JPanel();
    panelSelectRobots.setLayout(new GridLayout(0, 2));
    panelSelectRobots.setAutoscrolls(true);

    panelRobots.add(label, BorderLayout.NORTH);
    panelRobots.add(panelSelectRobots, BorderLayout.CENTER);

    // posicion de mi robot
    JPanel panelSetMyRobotPosition = new JPanel();
    // panelRobots.add(panelSetMyRobotPosition, BorderLayout.PAGE_END);
    panelSetMyRobotPosition.setLayout(new FlowLayout());
    JLabel ownPosition = new JLabel(Language.get("myRobotPosition") + " " + HelperEditor.currentRobotName);
    ownPosition.setFont(new Font("sansserif", Font.BOLD, 12));
    panelSetMyRobotPosition.add(ownPosition);
    // Posicion de mi robot
    buttonPos = new JButton(icon);
    buttonPos.addActionListener(new PosicionRobotAction(HelperEditor.currentRobotName)); // el nombre aqui es solo a
    // modo informativo
    buttonPos.setPreferredSize(new Dimension(30, 30));
    panelSetMyRobotPosition.add(buttonPos);
    positionComponents.add(buttonPos);

    // Matas
    JPanel panelSelectRoundsNumber = new JPanel();
    // panelRobots.add(panelSelectRoundsNumber, BorderLayout.SOUTH);
    panelSelectRoundsNumber.setLayout(new FlowLayout());
    panelSelectRoundsNumber.add(new JLabel(Language.get("selectRoundsNumber")));
    //      this.roundsNumberTextField = new JTextField(
    //            Integer.toString(Batalla.NUMBER_OF_ROUNDS), 5);
    this.roundsNumberSpinner = new JSpinner(new SpinnerNumberModel(Batalla.NUMBER_OF_ROUNDS,
            Batalla.MIN_NUMBER_OF_ROUNDS, Batalla.MAX_NUMBER_OF_ROUNDS, 1));

    panelSelectRoundsNumber.add(this.roundsNumberSpinner);

    JPanel panelSouth = new JPanel();
    panelSouth.setLayout(new GridLayout(4, 1));

    panelSouth.add(panelSetMyRobotPosition);
    //this.getContentPane().add(randomMode, BorderLayout.SOUTH);
    panelSouth.add(randomMode);
    panelSouth.add(new JSeparator());
    panelSouth.add(panelSelectRoundsNumber);
    panelRobots.add(panelSouth, BorderLayout.SOUTH);

    JPanel panelOkCancel = new JPanel();
    this.getContentPane().add(panelOkCancel, BorderLayout.SOUTH);
    panelOkCancel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 12));

    btnOK = new JButton(Language.get("selectStartBattle"));
    btnOK.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            startBattle(panelSelectRobots);
        }
    });
    // comienza deshabilitado hasta que se seleccione 1 enemigo
    // btnOK.setEnabled(false);
    panelOkCancel.add(btnOK);

    JButton btnCancel = new JButton(Language.get("cancel"));
    btnCancel.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            closeDialog();
        }
    });
    panelOkCancel.add(btnCancel);

    btnSelectAll.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            selectChecks(panelSelectRobots, true);
            // btnOK.setEnabled(true);
        }
    });

    btnSelectNone.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            selectChecks(panelSelectRobots, false);
            // btnOK.setEnabled(false);
        }
    });

    // TODO Agregar funcionalidad de elegir las posiciones iniciales de los
    // robots.
    // TODO Averiguar como pasar las posiciones para que se elijan de manera
    // random, probar (0,0,0)

    try {
        robotNameClicked = new RobotNameClickedEvent(btnOK);
        addRobotsToPanel(panelSelectRobots);

        this.setResizable(false);
        this.pack();
        PositionCalc.centerDialog(this);
        enablePositionOptions(false);
        this.setVisible(true);
    } catch (FileNotFoundException e) {
        throw new NoEnemiesException(e.getMessage());
    }

}

From source file:ro.nextreports.engine.exporter.ResultExporter.java

private void buildCellVAllign(Map<String, Object> format, int vAllign) {
    if (SwingConstants.CENTER == vAllign) {
        format.put(StyleFormatConstants.VERTICAL_ALIGN_KEY, StyleFormatConstants.VERTICAL_ALIGN_MIDDLE);
    }/*  w w  w. j  a va 2 s .co  m*/
    if (SwingConstants.TOP == vAllign) {
        format.put(StyleFormatConstants.VERTICAL_ALIGN_KEY, StyleFormatConstants.VERTICAL_ALIGN_TOP);
    }
    if (SwingConstants.BOTTOM == vAllign) {
        format.put(StyleFormatConstants.VERTICAL_ALIGN_KEY, StyleFormatConstants.VERTICAL_ALIGN_BOTTOM);
    }

}