mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-27 14:58:55 +01:00
First implementation of a bookmarks system.
Not persistent yet, so you lose them all when you close ATCS.
This commit is contained in:
@@ -1779,6 +1779,20 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
}
|
||||
});
|
||||
savePane.add(delete, JideBoxLayout.FIX);
|
||||
final JButton bookmark = new JButton(new ImageIcon(map.bookmark != null ? DefaultIcons.getBookmarkActiveIcon() : DefaultIcons.getBookmarkInactiveIcon()));
|
||||
savePane.add(bookmark, JideBoxLayout.FIX);
|
||||
bookmark.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
if (map.bookmark == null) {
|
||||
map.getProject().bookmark(map);
|
||||
bookmark.setIcon(new ImageIcon(DefaultIcons.getBookmarkActiveIcon()));
|
||||
} else {
|
||||
map.bookmark.delete();
|
||||
bookmark.setIcon(new ImageIcon(DefaultIcons.getBookmarkInactiveIcon()));
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (proj.getMap(map.id) != map) {
|
||||
savePane.add(message = new JLabel(ALTERED_EXISTS_MESSAGE), JideBoxLayout.FIX);
|
||||
@@ -1842,6 +1856,20 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
}
|
||||
}
|
||||
});
|
||||
final JButton bookmark = new JButton(new ImageIcon(map.bookmark != null ? DefaultIcons.getBookmarkActiveIcon() : DefaultIcons.getBookmarkInactiveIcon()));
|
||||
savePane.add(bookmark, JideBoxLayout.FIX);
|
||||
bookmark.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
if (map.bookmark == null) {
|
||||
map.getProject().bookmark(map);
|
||||
bookmark.setIcon(new ImageIcon(DefaultIcons.getBookmarkActiveIcon()));
|
||||
} else {
|
||||
map.bookmark.delete();
|
||||
bookmark.setIcon(new ImageIcon(DefaultIcons.getBookmarkInactiveIcon()));
|
||||
}
|
||||
}
|
||||
});
|
||||
//Placeholder. Fills the eventual remaining space.
|
||||
savePane.add(new JPanel(), JideBoxLayout.VARY);
|
||||
pane.add(savePane, JideBoxLayout.FIX);
|
||||
|
||||
Reference in New Issue
Block a user