public void init() { topPanel = new JPanel(); LayoutManager gridBagLayout = new GridBagLayout(); Dimension preferredSize = new Dimension(); preferredSize.setSize(3810, 975); topPanel.setPreferredSize(preferredSize); topPanel.setLayout(gridBagLayout); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; /* Set up the encounter. */ // encounter = new KoboldLairOutsideEncounter(); Encounter.setEncounter(encounter); encounter.init(); partyPanel.init(encounter.getCreatures()); battlefieldPanel.init(encounter.getMap(), encounter.getCreatures()); battleMapScrollPane = new JScrollPane(); Dimension battleMapScrollPaneDimension = new Dimension(1055, 975); battleMapScrollPane.setPreferredSize(battleMapScrollPaneDimension); battleMapScrollPane.createHorizontalScrollBar(); battleMapScrollPane.createVerticalScrollBar(); battleMapScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); battleMapScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); battleMapScrollPane.getVerticalScrollBar().setUnitIncrement(16); battleMapScrollPane.add(battlefieldPanel); battleMapScrollPane.setViewportView(battlefieldPanel); bufferBetweenMonitors = new JPanel(); Dimension bufferDimension = new Dimension(10, 975); bufferBetweenMonitors.setPreferredSize(bufferDimension); creatureScrollPane = new JScrollPane(); Dimension creatureScrollPaneDimension = new Dimension(725, 975); creatureScrollPane.setPreferredSize(creatureScrollPaneDimension); creatureScrollPane.createHorizontalScrollBar(); creatureScrollPane.createVerticalScrollBar(); creatureScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); creatureScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); creatureScrollPane.getVerticalScrollBar().setUnitIncrement(16); creatureScrollPane.add(partyPanel); creatureScrollPane.setViewportView(partyPanel); battleCardsScrollPane = new JScrollPane(); Dimension battleCardsScrollPaneDimension = new Dimension(1170, 975); battleCardsScrollPane.setPreferredSize(battleCardsScrollPaneDimension); battleCardsScrollPane.createHorizontalScrollBar(); battleCardsScrollPane.createVerticalScrollBar(); battleCardsScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); battleCardsScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); battleCardsScrollPane.getVerticalScrollBar().setUnitIncrement(16); battleCardPanel.init(); battleCardsScrollPane.add(battleCardPanel); battleCardsScrollPane.setViewportView(battleCardPanel); console = new IntegratedCommandConsole(); console.addPropertyChangeListener(consolePanel); console.setConsolePanel(consolePanel); topPanel.add(battleMapScrollPane, c); topPanel.add(consolePanel, c); topPanel.add(bufferBetweenMonitors, c); topPanel.add(creatureScrollPane, c); topPanel.add(battleCardsScrollPane, c); add(topPanel); Utils.setICC(console); Utils.setGui(this); }
public void run() { encounter.runEncounter(); }