}
});
}
private StandardPane createMainPane() {
return new StandardPane() {
@Override
protected void build() {
setLayout(new BorderLayout());
JPanel panelTwoLists = new JPanel();
panelTwoLists.setLayout(new BoxLayout(panelTwoLists, BoxLayout.PAGE_AXIS));
panelTwoLists.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
JPanel paneNoteList = createPaneNoteList();
JPanel paneTagList = createPaneTagList();
JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
split.setDividerLocation(150);
split.setOneTouchExpandable(true);
split.add(paneTagList);
split.add(paneNoteList);
panelTwoLists.add(split);
add(panelTwoLists, BorderLayout.CENTER);
add(createPaneButtons(), BorderLayout.SOUTH);
}
private StandardPane createPaneTagList() {
return new StandardPane() {
@Override
protected void build() {
setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
StandardPane paneTagList = this.createPaneTagList();
fieldListIncludedTags = new JList();
fieldListIncludedTags.setCellRenderer(new TagListRenderer());
fieldListIncludedTags.setLayoutOrientation(JList.VERTICAL_WRAP);
fieldListIncludedTags.setVisibleRowCount(-1);
fieldListExcludedTags = new JList();
fieldListExcludedTags.setCellRenderer(new TagListRenderer());
fieldListExcludedTags.setLayoutOrientation(JList.VERTICAL_WRAP);
fieldListExcludedTags.setVisibleRowCount(-1);
add(paneTagList);
add(fieldListIncludedTags);
add(fieldListExcludedTags);
}
private StandardPane createPaneTagList() {
return new StandardPane() {
@Override
protected void build() {
setLayout(new BorderLayout());
paneTag = new JPanel();
paneTag.setBackground(Color.WHITE);
add(paneTag,BorderLayout.CENTER);
}
};
}
};
}
private StandardPane createPaneNoteList() {
return new StandardPane() {
@Override
protected void build() {
setLayout(new BorderLayout());
fieldListNote = new JList() {
@Override
public JToolTip createToolTip() {
MultiLineToolTip tip = new MultiLineToolTip();
tip.setComponent(this);
return tip;
}
};
fieldListNote.setCellRenderer(new NoteListRenderer());
fieldListNote.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
add(createSearchPane(), BorderLayout.NORTH);
add(new JScrollPane(fieldListNote), BorderLayout.CENTER);
}
private StandardPane createSearchPane() {
return new StandardPane() {
@Override
protected void build() {
setLayout(new BorderLayout());
fieldNoteSearch = new JTextField();
fieldResetSearchButton = new JButton(Tr._("search.reset"));
add(fieldNoteSearch, BorderLayout.CENTER);
add(fieldResetSearchButton,BorderLayout.EAST);
}
};
}
};
}
private StandardPane createPaneButtons() {
return new StandardPane() {
@Override
protected void build() {
fieldNewButton = new JButton(Tr._("note.new"));
add(fieldNewButton);