예제 #1
0
  private void prepareTileStoreInfoPanel() {

    final GridBagConstraints gbc_mapSource = new GridBagConstraints();
    gbc_mapSource.insets = new Insets(5, 10, 5, 10);
    gbc_mapSource.anchor = GridBagConstraints.WEST;
    final GridBagConstraints gbc_mapTiles = new GridBagConstraints();
    gbc_mapTiles.insets = gbc_mapSource.insets;
    gbc_mapTiles.anchor = GridBagConstraints.EAST;
    final GridBagConstraints gbc_eol = new GridBagConstraints();
    gbc_eol.gridwidth = GridBagConstraints.REMAINDER;

    TileStore tileStore = TileStore.getInstance();
    MapSourcesManager mapSourcesManager = MapSourcesManager.getInstance();

    tileStoreInfoPanel.add(new JLabel("<html><b>Map source</b></html>"), gbc_mapSource);
    tileStoreInfoPanel.add(new JLabel("<html><b>Tiles</b></html>"), gbc_mapTiles);
    tileStoreInfoPanel.add(new JLabel("<html><b>Size</b></html>"), gbc_eol);

    ImageIcon trash = Utilities.loadResourceImageIcon("trash.png");

    for (String name : tileStore.getAllStoreNames()) {
      String mapTileCountText = "  ?  ";
      String mapTileSizeText = "    ?    ";
      MapSource mapSource = mapSourcesManager.getSourceByName(name);
      final JLabel mapSourceNameLabel;
      if (mapSource != null) mapSourceNameLabel = new JLabel(name);
      else mapSourceNameLabel = new JLabel(name + " (unused)");
      final JLabel mapTileCountLabel = new JLabel(mapTileCountText);
      final JLabel mapTileSizeLabel = new JLabel(mapTileSizeText);
      final JButton deleteButton = new JButton(trash);
      TileSourceInfoComponents info = new TileSourceInfoComponents();
      info.name = name;
      info.countLabel = mapTileCountLabel;
      info.sizeLabel = mapTileSizeLabel;
      tileStoreInfoList.add(info);
      deleteButton.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
      deleteButton.setToolTipText("Delete all stored " + name + " tiles.");
      deleteButton.addActionListener(new ClearTileCacheAction(name));

      tileStoreInfoPanel.add(mapSourceNameLabel, gbc_mapSource);
      tileStoreInfoPanel.add(mapTileCountLabel, gbc_mapTiles);
      tileStoreInfoPanel.add(mapTileSizeLabel, gbc_mapTiles);
      tileStoreInfoPanel.add(deleteButton, gbc_eol);
    }
    JSeparator hr = new JSeparator(JSeparator.HORIZONTAL);
    hr.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    tileStoreInfoPanel.add(hr, gbc);

    JLabel totalMapLabel = new JLabel("<html><b>Total</b></html>");
    totalTileCountLabel = new JLabel("<html><b>??</b></html>");
    totalTileSizeLabel = new JLabel("<html><b>??</b></html>");
    tileStoreInfoPanel.add(totalMapLabel, gbc_mapSource);
    tileStoreInfoPanel.add(totalTileCountLabel, gbc_mapTiles);
    tileStoreInfoPanel.add(totalTileSizeLabel, gbc_mapTiles);
  }
예제 #2
0
 ToolBarTablePane(JToolBar toolBar, JTable table) {
   super(new BorderLayout());
   setOpaque(false);
   JPanel t = new JPanel(new BorderLayout());
   t.setOpaque(false);
   toolBar.setOpaque(false);
   t.add(toolBar, BorderLayout.NORTH);
   JSeparator sep = new JSeparator(JSeparator.HORIZONTAL);
   sep.setOpaque(false);
   sep.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0));
   t.add(sep, BorderLayout.CENTER);
   JScrollPane scroller =
       new JScrollPane(table) {
         public Dimension getPreferredSize() {
           return new Dimension(super.getPreferredSize().width, 240);
         }
       };
   ;
   scroller.setOpaque(false);
   scroller.setBorder(BorderFactory.createLineBorder(UIManager.getColor("Label.foreground")));
   add(t, BorderLayout.NORTH);
   add(scroller, BorderLayout.CENTER);
 }
예제 #3
0
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    javax.swing.JPanel buttonPanel = new javax.swing.JPanel();
    this.logoutButton = new javax.swing.JButton();
    this.closeButton = new javax.swing.JButton();
    //        newsessionButton = new javax.swing.JButton();
    javax.swing.JPanel titlePanel = new javax.swing.JPanel();
    javax.swing.JLabel jLabel1 =
        new javax.swing.JLabel(
            de.fhma.ss10.srn.tischbein.gui.launcher.Launcher.PRODUCT_NAME
                + " - Ultra Deluxe Gourmet Version");
    javax.swing.JLabel jLabel2 = new javax.swing.JLabel();
    javax.swing.JPanel jPanel2 = new javax.swing.JPanel();
    javax.swing.JSplitPane jSplitPane1 = new javax.swing.JSplitPane();
    javax.swing.JPanel filesPanel = new javax.swing.JPanel();
    javax.swing.JPanel myFilesPanel = new javax.swing.JPanel();
    javax.swing.JScrollPane jScrollPane2 = new javax.swing.JScrollPane();
    this.userFilesList = new javax.swing.JList();
    javax.swing.JPanel jPanel1 = new javax.swing.JPanel();
    this.uploadButton = new javax.swing.JButton();
    this.deleteButton = new javax.swing.JButton();
    javax.swing.JSeparator jSeparator1 = new javax.swing.JSeparator();
    javax.swing.JPanel otherFilesPanel = new javax.swing.JPanel();
    javax.swing.JScrollPane jScrollPane3 = new javax.swing.JScrollPane();
    this.otherFilesList = new javax.swing.JList();
    javax.swing.JSplitPane jSplitPane2 = new javax.swing.JSplitPane();
    this.viewPanel = new javax.swing.JPanel();
    javax.swing.JScrollPane fileViewScrollArea = new javax.swing.JScrollPane();
    this.fileView = new javax.swing.JTextArea();
    javax.swing.JPanel userPanel = new javax.swing.JPanel();
    javax.swing.JScrollPane jScrollPane5 = new javax.swing.JScrollPane();
    this.accessTable = new javax.swing.JTable();
    javax.swing.JSeparator jSeparator2 = new javax.swing.JSeparator();

    this.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    this.setTitle("Tischbein v0.2");
    this.setMinimumSize(new java.awt.Dimension(640, 480));

    buttonPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 0, 0));

    this.logoutButton.setText("Logout");
    buttonPanel.add(this.logoutButton);

    this.closeButton.setText("Beenden");
    buttonPanel.add(this.closeButton);

    //        newsessionButton.setText("Neue Session");
    //        buttonPanel.add(newsessionButton);

    this.getContentPane().add(buttonPanel, java.awt.BorderLayout.SOUTH);

    jLabel1.setFont(new java.awt.Font("Candara", 1, 18));
    titlePanel.add(jLabel1);

    jLabel2.setFont(new java.awt.Font("Candara", 0, 8));
    jLabel2.setText("(mit Porno-Hack)");
    titlePanel.add(jLabel2);

    this.getContentPane().add(titlePanel, java.awt.BorderLayout.NORTH);

    jPanel2.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    jPanel2.setLayout(new javax.swing.BoxLayout(jPanel2, javax.swing.BoxLayout.Y_AXIS));

    jSplitPane1.setContinuousLayout(true);

    filesPanel.setMinimumSize(new java.awt.Dimension(150, 130));
    filesPanel.setPreferredSize(new java.awt.Dimension(150, 478));
    filesPanel.setLayout(new javax.swing.BoxLayout(filesPanel, javax.swing.BoxLayout.PAGE_AXIS));

    myFilesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Eigene Dateien"));
    myFilesPanel.setLayout(
        new javax.swing.BoxLayout(myFilesPanel, javax.swing.BoxLayout.LINE_AXIS));

    jScrollPane2.setViewportView(this.userFilesList);

    myFilesPanel.add(jScrollPane2);

    filesPanel.add(myFilesPanel);

    jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.LINE_AXIS));

    this.uploadButton.setText("Hochladen");
    jPanel1.add(this.uploadButton);

    this.deleteButton.setText("Löschen");
    jPanel1.add(this.deleteButton);

    filesPanel.add(jPanel1);
    filesPanel.add(jSeparator1);

    otherFilesPanel.setBorder(
        javax.swing.BorderFactory.createTitledBorder("Freigeschaltete Dateien"));
    otherFilesPanel.setLayout(
        new javax.swing.BoxLayout(otherFilesPanel, javax.swing.BoxLayout.LINE_AXIS));

    jScrollPane3.setViewportView(this.otherFilesList);

    otherFilesPanel.add(jScrollPane3);

    filesPanel.add(otherFilesPanel);

    jSplitPane1.setLeftComponent(filesPanel);

    jSplitPane2.setResizeWeight(1.0);
    jSplitPane2.setContinuousLayout(true);

    this.viewPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
    this.viewPanel.setLayout(
        new javax.swing.BoxLayout(this.viewPanel, javax.swing.BoxLayout.LINE_AXIS));

    this.fileView.setColumns(20);
    this.fileView.setEditable(false);
    this.fileView.setLineWrap(true);
    this.fileView.setRows(5);
    fileViewScrollArea.setViewportView(this.fileView);

    this.viewPanel.add(fileViewScrollArea);

    jSplitPane2.setLeftComponent(this.viewPanel);

    userPanel.setBorder(
        javax.swing.BorderFactory.createTitledBorder(
            javax.swing.BorderFactory.createTitledBorder("Benutzererlaubnis")));
    userPanel.setMinimumSize(new java.awt.Dimension(150, 63));
    userPanel.setPreferredSize(new java.awt.Dimension(150, 130));
    userPanel.setLayout(new javax.swing.BoxLayout(userPanel, javax.swing.BoxLayout.LINE_AXIS));

    this.accessTable.setModel(
        new javax.swing.table.DefaultTableModel(
            new Object[][] {
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null}
            },
            new String[] {"Title 1", "Title 2", "Title 3", "Title 4"}));
    jScrollPane5.setViewportView(this.accessTable);

    userPanel.add(jScrollPane5);

    jSplitPane2.setRightComponent(userPanel);

    jSplitPane1.setRightComponent(jSplitPane2);

    jPanel2.add(jSplitPane1);

    jSeparator2.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    jPanel2.add(jSeparator2);

    this.getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);

    this.pack();
  } // </editor-fold>//GEN-END:initComponents