36 |
36 |
private static final long serialVersionUID = 1L;
|
37 |
37 |
|
38 |
38 |
/**Minimalni rozmer vypisoveho okna*/
|
39 |
|
private static final Dimension OUTPUT_WINDOW_MIN_DIM = new Dimension(320, 160);
|
|
39 |
private static final Dimension OUTPUT_WINDOW_MIN_DIM = new Dimension(640, 320);
|
40 |
40 |
|
41 |
41 |
/**konstanta pro oznaceni souboru se spoji*/
|
42 |
42 |
private static final int SEZNAM_LINEK_FILE = 0;
|
... | ... | |
136 |
136 |
JPanel jdfPathP = new JPanel();
|
137 |
137 |
JPanel outputP = new JPanel();
|
138 |
138 |
inputP.setLayout(new GridLayout(5, 1));
|
139 |
|
ImageIcon icon = new ImageIcon(Window.class.getResource("/resources/poved.png"));
|
140 |
|
ImageIcon logo = new ImageIcon(Window.class.getResource("/resources/logo.png"));
|
141 |
|
this.setIconImage(icon.getImage());
|
142 |
139 |
dateFromP.setLayout(new FlowLayout());
|
143 |
140 |
dateToP.setLayout(new FlowLayout());
|
144 |
141 |
spojPathP.setLayout(new FlowLayout());
|
... | ... | |
146 |
143 |
outputP.setLayout(new FlowLayout());
|
147 |
144 |
|
148 |
145 |
//inicializace kompoment
|
|
146 |
ImageIcon icon = new ImageIcon(Window.class.getResource("/resources/poved.png"));
|
|
147 |
ImageIcon logo = new ImageIcon(Window.class.getResource("/resources/logo.png"));
|
149 |
148 |
JLabel povedLB = new JLabel(logo, JLabel.CENTER);
|
150 |
149 |
JLabel dateFromLB = new JLabel("Obdobi od: ");
|
151 |
150 |
JLabel dateToLB = new JLabel ("Obdobi do: ");
|
... | ... | |
167 |
166 |
initDatePicker();
|
168 |
167 |
|
169 |
168 |
//nastaveni komponent
|
|
169 |
this.setIconImage(icon.getImage());
|
170 |
170 |
linkyPathTF.setEditable(false);
|
171 |
171 |
jdfPathTF.setEditable(false);
|
172 |
172 |
outputPathTF.setEditable(false);
|
173 |
173 |
outputNameTF.setText("Nazev souboru");
|
|
174 |
infoTA.setEditable(false);
|
|
175 |
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
|
|
176 |
|
|
177 |
|
|
178 |
//pridani listeneru
|
174 |
179 |
outputNameTF.addMouseListener(new MouseAdapter() {
|
175 |
180 |
@Override
|
|
181 |
/**
|
|
182 |
* pokud je zapsan vychozi text, po kliknuti se vymaze
|
|
183 |
*
|
|
184 |
* @param e kod udalosti
|
|
185 |
*/
|
176 |
186 |
public void mouseClicked(MouseEvent e) {
|
177 |
187 |
if (outputNameTF.getText().trim().equals("Nazev souboru") ) outputNameTF.setText("");
|
178 |
188 |
}
|
179 |
189 |
});
|
180 |
|
infoTA.setEditable(false);
|
181 |
|
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
|
182 |
|
|
183 |
|
|
184 |
|
//pridani listeneru k buttonum
|
185 |
190 |
confirmBT.addActionListener(new ConfirmListener());
|
186 |
191 |
endBT.addActionListener(new ActionListener(){
|
187 |
|
//@Override
|
|
192 |
@Override
|
188 |
193 |
/**
|
189 |
194 |
* ukonci program
|
190 |
195 |
*
|
... | ... | |
277 |
282 |
infoTA.append(message + "\n");
|
278 |
283 |
}
|
279 |
284 |
|
|
285 |
/**
|
|
286 |
* vytvori instanci {@code BitmapBuilder} a vrati ji
|
|
287 |
*
|
|
288 |
* @return nove vytvořena instance
|
|
289 |
*/
|
280 |
290 |
private BitmapBuilder createBitmapBuilder(){
|
281 |
291 |
return new BitmapBuilder(this, outputFile);
|
282 |
292 |
}
|
... | ... | |
313 |
323 |
|
314 |
324 |
|
315 |
325 |
ArrayList<String[]> loadedData;
|
316 |
|
|
317 |
326 |
BitmapBuilder bitmapBuilder = createBitmapBuilder();
|
|
327 |
|
318 |
328 |
//loader pro načtení dat
|
319 |
329 |
DataLoader loader = new DataLoader(jdfDir);
|
320 |
330 |
|
321 |
331 |
//načítání konkrétních dat
|
322 |
|
|
323 |
332 |
String[] lineList = loader.loadLines(linkyFile);
|
324 |
333 |
bitmapBuilder.getLineList(lineList);
|
325 |
334 |
|
... | ... | |
334 |
343 |
loadedData = loader.loadData(SPOJE);
|
335 |
344 |
bitmapBuilder.getSpoje(loadedData);
|
336 |
345 |
|
337 |
|
printMessage("Zapisuji bitmapy..");
|
338 |
346 |
bitmapBuilder.writeBitmaps(dateFrom, dateTo);
|
339 |
347 |
|
340 |
348 |
printMessage("Ukončuji program..");
|
... | ... | |
520 |
528 |
|
521 |
529 |
/**
|
522 |
530 |
*
|
523 |
|
* hlavni metoda pro ozkouseni funkcnosti {@code Window}
|
|
531 |
* hlavni metoda a vstupni bod aplikace
|
524 |
532 |
*
|
525 |
533 |
* @param args parametry programu
|
526 |
534 |
*/
|
Přidány výpisy, doplněny komentáře a menší úpravy ve Window (Re #7320)