public CargoPanel() {
      super();

      setOpaque(false);
      setBorder(Utility.localizedBorder("cargoOnCarrier"));
      addMouseListener(TradeRouteInputPanel.this.dropListener);
    }
    public GoodsPanel() {
      super(new GridLayout(0, 4, MARGIN, MARGIN));

      for (GoodsType goodsType : getSpecification().getGoodsTypeList()) {
        if (goodsType.isStorable()) {
          CargoLabel label = new CargoLabel(goodsType);
          add(label);
        }
      }
      setOpaque(false);
      setBorder(Utility.localizedBorder("goods"));
      addMouseListener(TradeRouteInputPanel.this.dropListener);
    }
Esempio n. 3
0
 private JPanel displayStatsMessage(String title, Map<String, String> stats) {
   JPanel panel = new JPanel();
   panel.setBorder(Utility.localizedBorder(title));
   Box b = new Box(BoxLayout.Y_AXIS);
   panel.add(b);
   Map<String, String> memory = new HashMap<>();
   Map<String, String> ai = new HashMap<>();
   for (String k : memoryKeys) {
     memory.put(Messages.message("memoryManager." + k), stats.remove(k));
   }
   for (String k : new ArrayList<>(stats.keySet())) {
     if (k.startsWith("AI")) { // FIXME: AIMain.aiStatisticsPrefix
       ai.put(k, stats.remove(k));
     }
   }
   b.add(createStatsTable("Memory", memory));
   b.add(createStatsTable("Game", stats));
   if (ai.isEmpty()) {
     b.add(new JLabel());
   } else {
     b.add(createStatsTable("AI", ai));
   }
   return panel;
 }