mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
clearing dead code and looking into tab placement issues
This commit is contained in:
@@ -345,7 +345,7 @@ public class ContributionListPanel extends JPanel implements Scrollable, Contrib
|
||||
if (table.isRowSelected(row)) {
|
||||
label.setBackground(new Color(0xe0fffd));
|
||||
}
|
||||
label.setFont(ContributionManagerDialog.myFont);
|
||||
label.setFont(ContributionManagerDialog.font);
|
||||
label.setOpaque(true);
|
||||
} else {
|
||||
if (contribution.isSpecial()) {
|
||||
|
||||
@@ -59,7 +59,6 @@ public class ContributionManagerDialog {
|
||||
// the calling editor, so updates can be applied
|
||||
Editor editor;
|
||||
|
||||
//The tabs
|
||||
ContributionTab toolsContributionTab;
|
||||
ContributionTab librariesContributionTab;
|
||||
ContributionTab examplesContributionTab;
|
||||
@@ -70,19 +69,17 @@ public class ContributionManagerDialog {
|
||||
ContributionListing contributionListing = ContributionListing.getInstance();
|
||||
|
||||
private JLabel[] tabLabels;
|
||||
|
||||
private JPanel updateTabPanel;
|
||||
|
||||
private JLabel updateTabLabel;
|
||||
|
||||
static Font myFont;
|
||||
static Font font;
|
||||
// disabling this because the icon sizing is not implemented correctly
|
||||
//static int iconVer = Toolkit.highResDisplay() ? 2 : 1;
|
||||
static final int iconVer = 1;
|
||||
|
||||
|
||||
public ContributionManagerDialog() {
|
||||
myFont = Toolkit.getSansFont(14, Font.PLAIN);
|
||||
font = Toolkit.getSansFont(14, Font.PLAIN);
|
||||
// GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(myFont);
|
||||
numberLabel = new JLabel(Toolkit.getLibIcon("manager/notification-" + iconVer + "x.png"), SwingConstants.CENTER);
|
||||
librariesContributionTab = new ContributionTab(ContributionType.LIBRARY, this);
|
||||
@@ -94,27 +91,19 @@ public class ContributionManagerDialog {
|
||||
|
||||
|
||||
/*
|
||||
public boolean hasUpdates() {
|
||||
return toolsContributionTab.hasUpdates()
|
||||
|| librariesContributionTab.hasUpdates()
|
||||
|| examplesContributionTab.hasUpdates()
|
||||
|| modesContributionTab.hasUpdates();
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
public boolean hasUpdates(Base base) {
|
||||
return librariesContributionTab.hasUpdates(base)
|
||||
|| modesContributionTab.hasUpdates(base)
|
||||
|| toolsContributionTab.hasUpdates(base)
|
||||
|| examplesContributionTab.hasUpdates(base);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
public void showFrame(Editor editor, ContributionType contributionType) {
|
||||
this.editor = editor;
|
||||
|
||||
//Calculating index to switch to the required tab
|
||||
// Calculating index to switch to the required tab
|
||||
int index;
|
||||
if (contributionType == ContributionType.LIBRARY) {
|
||||
index = 0;
|
||||
@@ -148,7 +137,7 @@ public class ContributionManagerDialog {
|
||||
}
|
||||
|
||||
|
||||
public void makeFrame(final Editor editor) {
|
||||
private void makeFrame(final Editor editor) {
|
||||
dialog = new JFrame(title);
|
||||
dialog.setMinimumSize(new Dimension(750, 500));
|
||||
tabbedPane = new JTabbedPane();
|
||||
@@ -270,7 +259,7 @@ public class ContributionManagerDialog {
|
||||
};
|
||||
tabLabels = new JLabel[4];
|
||||
|
||||
for(int i = 0 ; i < 4; i++){
|
||||
for (int i = 0 ; i < 4; i++) {
|
||||
final int temp = i;
|
||||
tabLabels[i] = new JLabel(tabTitles[i]){
|
||||
@Override
|
||||
@@ -312,22 +301,8 @@ public class ContributionManagerDialog {
|
||||
updateTabLabel.setForeground(Color.WHITE);
|
||||
updateTabPanel.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
|
||||
updateTabPanel.setPreferredSize(new Dimension(TAB_WIDTH, TAB_HEIGHT));
|
||||
// updateTabPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory
|
||||
// .createMatteBorder(0, 2, 0, 0, Color.BLACK), BorderFactory
|
||||
// .createEmptyBorder(4, 4, 4, 4)));
|
||||
tabbedPane.setTabComponentAt(4, updateTabPanel);
|
||||
|
||||
// JLabel tabLabels[] = new JLabel[4];
|
||||
// for(int i = 0 ; i < tabLabels.length;i++){
|
||||
// tabLabels[i] = new JLabel(tabTitles[i]);
|
||||
// tabLabels[i]
|
||||
// .setBorder(BorderFactory.createCompoundBorder(BorderFactory
|
||||
// .createMatteBorder(0, (i == 0 ? 0 : 2), 0, (i == 3 ? 2 : 0),
|
||||
// Color.BLACK), BorderFactory
|
||||
// .createEmptyBorder(4, 4, 4, 4)));
|
||||
// tabbedPane.setTabComponentAt(i, tabLabels[i]);
|
||||
// }
|
||||
|
||||
GroupLayout tabLayout = new GroupLayout(updateTabPanel);
|
||||
tabLayout.setAutoCreateGaps(true);
|
||||
updateTabPanel.setLayout(tabLayout);
|
||||
@@ -351,14 +326,6 @@ public class ContributionManagerDialog {
|
||||
|
||||
|
||||
public class SpacedTabbedPaneUI extends BasicTabbedPaneUI {
|
||||
protected Color hazAlfa(int fila) {
|
||||
int alfa = 0;
|
||||
if (fila >= 0) {
|
||||
alfa = 50 + (fila > 7 ? 70 : 10 * fila);
|
||||
}
|
||||
return new Color(0, 0, 0, alfa);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void installDefaults() {
|
||||
@@ -370,46 +337,36 @@ public class ContributionManagerDialog {
|
||||
tabAreaInsets = new Insets(0, 0, 0, 0);
|
||||
selectedTabPadInsets = new Insets(0, 0, 0, 0);
|
||||
}
|
||||
// @Override
|
||||
// protected int getTabLabelShiftX(int tabPlacement, int tabIndex,
|
||||
// boolean isSelected) {
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
protected int getTabLabelShiftY(int tabPlacement, int tabIndex,
|
||||
boolean isSelected) {
|
||||
return 1;
|
||||
}
|
||||
// @Override
|
||||
// protected void paintTab(Graphics g, int tabPlacement,
|
||||
// Rectangle[] rects, int tabIndex,
|
||||
// Rectangle iconRect, Rectangle textRect) {
|
||||
// Graphics2D g2 = (Graphics2D) g;
|
||||
// g2.fill(Toolkit.createRoundRect(rects[tabIndex].x, rects[tabIndex].y,
|
||||
// rects[tabIndex].x + rects[tabIndex].width, rects[tabIndex].y + rects[tabIndex].height,
|
||||
// 6,
|
||||
// 6,
|
||||
// 0, 0));
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
protected void paintTabBackground(Graphics g, int tabPlacement,
|
||||
int tabIndex, int x, int y, int w, int h,
|
||||
boolean isSelected) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex,
|
||||
int x, int y, int w, int h, boolean isSelected) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void paintFocusIndicator(Graphics g, int tabPlacement,
|
||||
Rectangle[] rects, int tabIndex,
|
||||
Rectangle iconRect, Rectangle textRect,
|
||||
boolean isSelected) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected LayoutManager createLayoutManager() {
|
||||
return new BasicTabbedPaneUI.TabbedPaneLayout() {
|
||||
@@ -460,200 +417,6 @@ public class ContributionManagerDialog {
|
||||
}
|
||||
|
||||
|
||||
/* *//**
|
||||
* Creates and arranges the Swing components in the dialog.
|
||||
*
|
||||
* @param panel1
|
||||
*//*
|
||||
private void createComponents(JPanel panel1) {
|
||||
dialog.setResizable(true);
|
||||
|
||||
Container pane = panel1;
|
||||
// pane.setLayout(new GridBagLayout());
|
||||
//
|
||||
// { // Shows "Filter by Category" and the combo box for selecting a category
|
||||
// GridBagConstraints c = new GridBagConstraints();
|
||||
// c.gridx = 0;
|
||||
// c.gridy = 0;
|
||||
pane.setLayout(new BorderLayout());
|
||||
|
||||
JPanel filterPanel = new JPanel();
|
||||
filterPanel.setLayout(new BoxLayout(filterPanel, BoxLayout.X_AXIS));
|
||||
// pane.add(filterPanel, c);
|
||||
pane.add(filterPanel, BorderLayout.NORTH);
|
||||
|
||||
filterPanel.add(Box.createHorizontalStrut(6));
|
||||
|
||||
JLabel categoryLabel = new JLabel(Language.text("contrib.category"));
|
||||
filterPanel.add(categoryLabel);
|
||||
|
||||
filterPanel.add(Box.createHorizontalStrut(5));
|
||||
|
||||
categoryChooser = new JComboBox<String>();
|
||||
categoryChooser.setMaximumRowCount(20);
|
||||
updateCategoryChooser();
|
||||
// filterPanel.add(categoryChooser, c);
|
||||
filterPanel.add(categoryChooser);
|
||||
categoryChooser.addItemListener(new ItemListener() {
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
category = (String) categoryChooser.getSelectedItem();
|
||||
if (ContributionManagerDialog.ANY_CATEGORY.equals(category)) {
|
||||
category = null;
|
||||
}
|
||||
filterLibraries(category, filterField.filters, isCompatibilityFilter);
|
||||
contributionListPanel.updateColors();
|
||||
}
|
||||
});
|
||||
|
||||
filterPanel.add(Box.createHorizontalStrut(5));
|
||||
// filterPanel.add(Box.createHorizontalGlue());
|
||||
filterField = new FilterField();
|
||||
filterPanel.add(filterField);
|
||||
|
||||
filterPanel.add(Box.createHorizontalStrut(5));
|
||||
|
||||
final JCheckBox compatibleContrib = new JCheckBox(compatibleCheckboxLabel);
|
||||
compatibleContrib.addItemListener(new ItemListener() {
|
||||
|
||||
@Override
|
||||
public void itemStateChanged(ItemEvent arg0) {
|
||||
isCompatibilityFilter = compatibleContrib.isSelected();
|
||||
filterLibraries(category, filterField.filters, isCompatibilityFilter);
|
||||
contributionListPanel.updateColors();
|
||||
}
|
||||
});
|
||||
filterPanel.add(compatibleContrib);
|
||||
// filterPanel.add(Box.createHorizontalGlue());
|
||||
// }
|
||||
//filterPanel.setBorder(new EmptyBorder(13, 13, 13, 13));
|
||||
filterPanel.setBorder(new EmptyBorder(7, 7, 7, 7));
|
||||
|
||||
// { // The scroll area containing the contribution listing and the status bar.
|
||||
// GridBagConstraints c = new GridBagConstraints();
|
||||
// c.fill = GridBagConstraints.BOTH;
|
||||
// c.gridx = 0;
|
||||
// c.gridy = 1;
|
||||
// c.gridwidth = 2;
|
||||
// c.weighty = 1;
|
||||
// c.weightx = 1;
|
||||
|
||||
scrollPane = new JScrollPane();
|
||||
scrollPane.setPreferredSize(new Dimension(300, 300));
|
||||
scrollPane.setViewportView(contributionListPanel);
|
||||
// scrollPane.getViewport().setOpaque(true);
|
||||
// scrollPane.getViewport().setBackground(contributionListPanel.getBackground());
|
||||
scrollPane
|
||||
.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
|
||||
scrollPane
|
||||
.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
// scrollPane.setBorder(new EmptyBorder(0, 7, 0, 7));
|
||||
pane.add(scrollPane, BorderLayout.CENTER);
|
||||
|
||||
pane.add(Box.createHorizontalStrut(10), BorderLayout.WEST);
|
||||
pane.add(Box.createHorizontalStrut(10), BorderLayout.EAST);
|
||||
|
||||
status = new StatusPanel();
|
||||
// status.setBorder(new EmptyBorder(7, 7, 7, 7));
|
||||
|
||||
JPanel statusRestartPane = new JPanel();
|
||||
statusRestartPane.setLayout(new BorderLayout());
|
||||
|
||||
statusRestartPane.setBorder(new EmptyBorder(7, 7, 7, 7));
|
||||
statusRestartPane.setOpaque(false);
|
||||
|
||||
statusRestartPane.add(status, BorderLayout.WEST);
|
||||
statusRestartPane.add(progressBar, BorderLayout.LINE_END);
|
||||
|
||||
Adding both of these to EAST shouldn't pose too much of a problem,
|
||||
// since they can never get added together.
|
||||
statusRestartPane.add(restartButton, BorderLayout.EAST);
|
||||
statusRestartPane.add(retryConnectingButton, BorderLayout.EAST);
|
||||
|
||||
pane.add(statusRestartPane, BorderLayout.SOUTH);
|
||||
|
||||
// status = new StatusPanel();
|
||||
// status.setBorder(BorderFactory.createEtchedBorder());
|
||||
|
||||
// final JLayeredPane layeredPane = new JLayeredPane();
|
||||
// layeredPane.add(scrollPane, JLayeredPane.DEFAULT_LAYER);
|
||||
// layeredPane.add(status, JLayeredPane.PALETTE_LAYER);
|
||||
//
|
||||
// layeredPane.addComponentListener(new ComponentAdapter() {
|
||||
//
|
||||
// void resizeLayers() {
|
||||
// scrollPane.setSize(layeredPane.getSize());
|
||||
// scrollPane.updateUI();
|
||||
// }
|
||||
//
|
||||
// public void componentShown(ComponentEvent e) {
|
||||
// resizeLayers();
|
||||
// }
|
||||
//
|
||||
// public void componentResized(ComponentEvent arg0) {
|
||||
// resizeLayers();
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// final JViewport viewport = scrollPane.getViewport();
|
||||
// viewport.addComponentListener(new ComponentAdapter() {
|
||||
// void resizeLayers() {
|
||||
// status.setLocation(0, viewport.getHeight() - 18);
|
||||
//
|
||||
// Dimension d = viewport.getSize();
|
||||
// d.height = 20;
|
||||
// d.width += 3;
|
||||
// status.setSize(d);
|
||||
// }
|
||||
// public void componentShown(ComponentEvent e) {
|
||||
// resizeLayers();
|
||||
// }
|
||||
// public void componentResized(ComponentEvent e) {
|
||||
// resizeLayers();
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// pane.add(layeredPane, c);
|
||||
// }
|
||||
|
||||
// { // The filter text area
|
||||
// GridBagConstraints c = new GridBagConstraints();
|
||||
// c.gridx = 0;
|
||||
// c.gridy = 2;
|
||||
// c.gridwidth = 2;
|
||||
// c.weightx = 1;
|
||||
// c.fill = GridBagConstraints.HORIZONTAL;
|
||||
// filterField = new FilterField();
|
||||
//
|
||||
// pane.add(filterField, c);
|
||||
// }
|
||||
|
||||
dialog.setMinimumSize(new Dimension(450, 400));
|
||||
}
|
||||
|
||||
private void updateCategoryChooser() {
|
||||
if (categoryChooser != null) {
|
||||
ArrayList<String> categories;
|
||||
categoryChooser.removeAllItems();
|
||||
categories = new ArrayList<String>(contribListing.getCategories(filter));
|
||||
// for (int i = 0; i < categories.size(); i++) {
|
||||
// System.out.println(i + " category: " + categories.get(i));
|
||||
// }
|
||||
Collections.sort(categories);
|
||||
// categories.add(0, ContributionManagerDialog.ANY_CATEGORY);
|
||||
boolean categoriesFound = false;
|
||||
categoryChooser.addItem(ContributionManagerDialog.ANY_CATEGORY);
|
||||
for (String s : categories) {
|
||||
categoryChooser.addItem(s);
|
||||
if (!s.equals("Unknown")) {
|
||||
categoriesFound = true;
|
||||
}
|
||||
}
|
||||
categoryChooser.setEnabled(categoriesFound);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
private void registerDisposeListeners() {
|
||||
dialog.addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent e) {
|
||||
@@ -680,65 +443,13 @@ public class ContributionManagerDialog {
|
||||
}
|
||||
|
||||
|
||||
/*protected void filterLibraries(String category, List<String> filters) {
|
||||
List<Contribution> filteredLibraries = contribListing
|
||||
.getFilteredLibraryList(category, filters);
|
||||
contributionListPanel.filterLibraries(filteredLibraries);
|
||||
}
|
||||
|
||||
protected void filterLibraries(String category, List<String> filters,
|
||||
boolean isCompatibilityFilter) {
|
||||
List<Contribution> filteredLibraries = contribListing
|
||||
.getFilteredLibraryList(category, filters);
|
||||
filteredLibraries = contribListing
|
||||
.getCompatibleContributionList(filteredLibraries, isCompatibilityFilter);
|
||||
contributionListPanel.filterLibraries(filteredLibraries);
|
||||
}
|
||||
*/
|
||||
/*protected void updateContributionListing() {
|
||||
if (editor != null) {
|
||||
ArrayList<Contribution> contributions = new ArrayList<Contribution>();
|
||||
|
||||
ArrayList<Library> libraries = new ArrayList<Library>(
|
||||
editor.getMode().contribLibraries);
|
||||
contributions.addAll(libraries);
|
||||
|
||||
//ArrayList<ToolContribution> tools = editor.contribTools;
|
||||
List<ToolContribution> tools = editor.getToolContribs();
|
||||
contributions.addAll(tools);
|
||||
|
||||
List<ModeContribution> modes = editor.getBase().getModeContribs();
|
||||
contributions.addAll(modes);
|
||||
|
||||
List<ExamplesContribution> examples = editor.getBase()
|
||||
.getExampleContribs();
|
||||
contributions.addAll(examples);
|
||||
|
||||
// ArrayList<LibraryCompilation> compilations = LibraryCompilation.list(libraries);
|
||||
//
|
||||
// // Remove libraries from the list that are part of a compilations
|
||||
// for (LibraryCompilation compilation : compilations) {
|
||||
// Iterator<Library> it = libraries.iterator();
|
||||
// while (it.hasNext()) {
|
||||
// Library current = it.next();
|
||||
// if (compilation.getFolder().equals(current.getFolder().getParentFile())) {
|
||||
// it.remove();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
contribListing.updateInstalledList(contributions);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
protected void downloadAndUpdateContributionListing(Base base) {
|
||||
void downloadAndUpdateContributionListing(Base base) {
|
||||
//activeTab is required now but should be removed
|
||||
//as there is only one instance of contribListing and it should be present in this class
|
||||
final ContributionTab activeTab = getActiveTab();
|
||||
activeTab.contribListing.downloadAvailableList(base, new ContribProgressBar(
|
||||
activeTab.progressBar) {
|
||||
|
||||
ContribProgressMonitor progress =
|
||||
new ContribProgressBar(activeTab.progressBar) {
|
||||
|
||||
@Override
|
||||
public void startTask(String name, int maxValue) {
|
||||
@@ -768,7 +479,8 @@ public class ContributionManagerDialog {
|
||||
makeAndShowTab(false, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
activeTab.contribListing.downloadAvailableList(base, progress);
|
||||
}
|
||||
|
||||
|
||||
@@ -781,11 +493,7 @@ public class ContributionManagerDialog {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the currently selected tab
|
||||
*/
|
||||
public ContributionTab getActiveTab() {
|
||||
ContributionTab getActiveTab() {
|
||||
switch (tabbedPane.getSelectedIndex()) {
|
||||
case 0:
|
||||
return librariesContributionTab;
|
||||
@@ -799,102 +507,4 @@ public class ContributionManagerDialog {
|
||||
return updatesContributionTab;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
protected void setFilterText(String filter) {
|
||||
if (filter == null || filter.isEmpty()) {
|
||||
filterField.setText("");
|
||||
filterField.showingHint = true;
|
||||
} else {
|
||||
filterField.setText(filter);
|
||||
filterField.showingHint = false;
|
||||
}
|
||||
filterField.applyFilter();
|
||||
}
|
||||
|
||||
// private JPanel getPlaceholder() {
|
||||
// return contributionListPanel.statusPlaceholder;
|
||||
// }
|
||||
|
||||
class FilterField extends JTextField {
|
||||
String filterHint;
|
||||
|
||||
boolean showingHint;
|
||||
|
||||
List<String> filters;
|
||||
|
||||
public FilterField() {
|
||||
super(Language.text("contrib.filter_your_search"));
|
||||
filterHint = Language.text("contrib.filter_your_search");
|
||||
|
||||
showingHint = true;
|
||||
filters = new ArrayList<String>();
|
||||
updateStyle();
|
||||
|
||||
addFocusListener(new FocusListener() {
|
||||
public void focusLost(FocusEvent focusEvent) {
|
||||
if (filterField.getText().isEmpty()) {
|
||||
showingHint = true;
|
||||
}
|
||||
updateStyle();
|
||||
}
|
||||
|
||||
public void focusGained(FocusEvent focusEvent) {
|
||||
if (showingHint) {
|
||||
showingHint = false;
|
||||
filterField.setText("");
|
||||
}
|
||||
updateStyle();
|
||||
}
|
||||
});
|
||||
|
||||
getDocument().addDocumentListener(new DocumentListener() {
|
||||
public void removeUpdate(DocumentEvent e) {
|
||||
applyFilter();
|
||||
}
|
||||
|
||||
public void insertUpdate(DocumentEvent e) {
|
||||
applyFilter();
|
||||
}
|
||||
|
||||
public void changedUpdate(DocumentEvent e) {
|
||||
applyFilter();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void applyFilter() {
|
||||
String filter = filterField.getFilterText();
|
||||
filter = filter.toLowerCase();
|
||||
|
||||
// Replace anything but 0-9, a-z, or : with a space
|
||||
filter = filter.replaceAll("[^\\x30-\\x39^\\x61-\\x7a^\\x3a]", " ");
|
||||
filters = Arrays.asList(filter.split(" "));
|
||||
filterLibraries(category, filters, isCompatibilityFilter);
|
||||
|
||||
contributionListPanel.updateColors();
|
||||
}
|
||||
|
||||
public String getFilterText() {
|
||||
return showingHint ? "" : getText();
|
||||
}
|
||||
|
||||
public void updateStyle() {
|
||||
if (showingHint) {
|
||||
setText(filterHint);
|
||||
// setForeground(UIManager.getColor("TextField.light")); // too light
|
||||
setForeground(Color.gray);
|
||||
setFont(getFont().deriveFont(Font.ITALIC));
|
||||
} else {
|
||||
setForeground(UIManager.getColor("TextField.foreground"));
|
||||
setFont(getFont().deriveFont(Font.PLAIN));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
public boolean hasAlreadyBeenOpened() {
|
||||
return dialog != null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,33 +89,13 @@ public class ContributionTab {
|
||||
}
|
||||
|
||||
|
||||
public ContributionTab() {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
public boolean hasUpdates() {
|
||||
return contribListing.hasUpdates();
|
||||
}
|
||||
*/
|
||||
public ContributionTab() { }
|
||||
|
||||
|
||||
public boolean hasUpdates(Base base) {
|
||||
return contribListing.hasUpdates(base);
|
||||
}
|
||||
|
||||
// protected JPanel makeTextPanel(String text) {
|
||||
// JPanel panel = new JPanel(false);
|
||||
// JLabel filler = new JLabel(text);
|
||||
// filler.setHorizontalAlignment(JLabel.CENTER);
|
||||
// panel.setLayout(new GridLayout(1, 1));
|
||||
// panel.add(filler);
|
||||
// return panel;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
public void showFrame(final Editor editor, boolean activateErrorPanel,
|
||||
final boolean isLoading) {
|
||||
@@ -131,8 +111,9 @@ public class ContributionTab {
|
||||
}
|
||||
|
||||
|
||||
public void setLayout(final Editor editor, boolean activateErrorPanel, boolean isLoading) {
|
||||
if(panel == null){
|
||||
public void setLayout(final Editor editor, boolean activateErrorPanel,
|
||||
boolean isLoading) {
|
||||
if (panel == null) {
|
||||
progressBar = new JProgressBar();
|
||||
progressBar.setVisible(false);
|
||||
createComponents();
|
||||
@@ -150,53 +131,6 @@ public class ContributionTab {
|
||||
loaderLabel.setBackground(Color.WHITE);
|
||||
}
|
||||
|
||||
/*restartButton = new JButton(Language.text("contrib.restart"));
|
||||
restartButton.setVisible(false);
|
||||
restartButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
|
||||
Iterator<Editor> iter = editor.getBase().getEditors().iterator();
|
||||
while (iter.hasNext()) {
|
||||
Editor ed = iter.next();
|
||||
if (ed.getSketch().isModified()) {
|
||||
int option = Base
|
||||
.showYesNoQuestion(editor, title,
|
||||
Language.text("contrib.unsaved_changes"),
|
||||
Language.text("contrib.unsaved_changes.prompt"));
|
||||
|
||||
if (option == JOptionPane.NO_OPTION)
|
||||
return;
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Thanks to http://stackoverflow.com/a/4160543
|
||||
StringBuilder cmd = new StringBuilder();
|
||||
cmd.append(System.getProperty("java.home") + File.separator + "bin"
|
||||
+ File.separator + "java ");
|
||||
for (String jvmArg : ManagementFactory.getRuntimeMXBean()
|
||||
.getInputArguments()) {
|
||||
cmd.append(jvmArg + " ");
|
||||
}
|
||||
cmd.append("-cp ")
|
||||
.append(ManagementFactory.getRuntimeMXBean().getClassPath())
|
||||
.append(" ");
|
||||
cmd.append(Base.class.getName());
|
||||
|
||||
try {
|
||||
Runtime.getRuntime().exec(cmd.toString());
|
||||
System.exit(0);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});*/
|
||||
|
||||
int scrollBarWidth = contributionListPanel.scrollPane.getVerticalScrollBar().getPreferredSize().width;
|
||||
|
||||
GroupLayout layout = new GroupLayout(panel);
|
||||
@@ -244,37 +178,35 @@ public class ContributionTab {
|
||||
|
||||
panel.setBackground(Color.WHITE);
|
||||
panel.setBorder(null);
|
||||
}
|
||||
|
||||
|
||||
/** Creates and arranges the Swing components in the dialog.
|
||||
*/
|
||||
private void createComponents() {
|
||||
|
||||
categoryLabel = new JLabel(Language.text("contrib.category"));
|
||||
|
||||
categoryChooser = new JComboBox<String>();
|
||||
categoryChooser.setMaximumRowCount(20);
|
||||
categoryChooser.setFont(Toolkit.getSansFont(14, Font.PLAIN));
|
||||
|
||||
updateCategoryChooser();
|
||||
|
||||
categoryChooser.addItemListener(new ItemListener() {
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
category = (String) categoryChooser.getSelectedItem();
|
||||
if (ContributionManagerDialog.ANY_CATEGORY.equals(category)) {
|
||||
category = null;
|
||||
}
|
||||
filterLibraries(category, filterField.filters);
|
||||
contributionListPanel.updateColors();
|
||||
}
|
||||
});
|
||||
|
||||
filterField = new FilterField();
|
||||
|
||||
buildErrorPanel();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void createComponents() {
|
||||
categoryLabel = new JLabel(Language.text("contrib.category"));
|
||||
|
||||
categoryChooser = new JComboBox<String>();
|
||||
categoryChooser.setMaximumRowCount(20);
|
||||
categoryChooser.setFont(Toolkit.getSansFont(14, Font.PLAIN));
|
||||
|
||||
updateCategoryChooser();
|
||||
|
||||
categoryChooser.addItemListener(new ItemListener() {
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
category = (String) categoryChooser.getSelectedItem();
|
||||
if (ContributionManagerDialog.ANY_CATEGORY.equals(category)) {
|
||||
category = null;
|
||||
}
|
||||
filterLibraries(category, filterField.filters);
|
||||
contributionListPanel.updateColors();
|
||||
}
|
||||
});
|
||||
|
||||
filterField = new FilterField();
|
||||
|
||||
buildErrorPanel();
|
||||
}
|
||||
|
||||
|
||||
void buildErrorPanel(){
|
||||
errorPanel = new JPanel();
|
||||
GroupLayout layout = new GroupLayout(errorPanel);
|
||||
@@ -297,30 +229,22 @@ public class ContributionTab {
|
||||
StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
|
||||
doc.setParagraphAttributes(0, doc.getLength(), center, false);
|
||||
|
||||
|
||||
closeButton = new JButton("X");
|
||||
closeButton.setContentAreaFilled(false);
|
||||
closeButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
contributionManagerDialog.makeAndShowTab(false, false);
|
||||
}
|
||||
});
|
||||
tryAgainButton = new JButton("Try Again");
|
||||
tryAgainButton.setFont(Toolkit.getSansFont(14, Font.PLAIN));
|
||||
// tryAgainButton.setContentAreaFilled(false);
|
||||
// tryAgainButton.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.BLACK, 1),BorderFactory.createEmptyBorder(3, 0, 3, 0)));
|
||||
tryAgainButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
contributionManagerDialog.makeAndShowTab(false, true);
|
||||
contributionManagerDialog.downloadAndUpdateContributionListing(editor.getBase());
|
||||
}
|
||||
});
|
||||
layout.setHorizontalGroup(layout
|
||||
.createSequentialGroup()
|
||||
layout.setHorizontalGroup(layout.createSequentialGroup()
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED,
|
||||
GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout
|
||||
@@ -332,8 +256,7 @@ public class ContributionTab {
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED,
|
||||
GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(closeButton));
|
||||
layout.setVerticalGroup(layout
|
||||
.createSequentialGroup()
|
||||
layout.setVerticalGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup().addComponent(errorMessage)
|
||||
.addComponent(closeButton)).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(tryAgainButton));
|
||||
errorPanel.setBackground(Color.PINK);
|
||||
@@ -341,7 +264,6 @@ public class ContributionTab {
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void updateCategoryChooser() {
|
||||
if (categoryChooser != null) {
|
||||
ArrayList<String> categories;
|
||||
@@ -371,14 +293,6 @@ public class ContributionTab {
|
||||
contributionListPanel.filterLibraries(filteredLibraries);
|
||||
}
|
||||
|
||||
/*
|
||||
protected void filterLibraries(String category, List<String> filters, boolean isCompatibilityFilter) {
|
||||
List<Contribution> filteredLibraries =
|
||||
contribListing.getFilteredLibraryList(category, filters);
|
||||
filteredLibraries = contribListing.getCompatibleContributionList(filteredLibraries, isCompatibilityFilter);
|
||||
contributionListPanel.filterLibraries(filteredLibraries);
|
||||
}*/
|
||||
|
||||
|
||||
protected void updateContributionListing() {
|
||||
if (editor != null) {
|
||||
@@ -438,10 +352,6 @@ public class ContributionTab {
|
||||
}
|
||||
|
||||
|
||||
// private JPanel getPlaceholder() {
|
||||
// return contributionListPanel.statusPlaceholder;
|
||||
// }
|
||||
|
||||
//TODO: this is causing a lot of bugs as the hint is wrongly firing applyFilter()
|
||||
class FilterField extends JTextField {
|
||||
Icon searchIcon;
|
||||
@@ -513,13 +423,13 @@ public class ContributionTab {
|
||||
|
||||
contributionListPanel.updateColors();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public boolean hasAlreadyBeenOpened() {
|
||||
return panel != null;
|
||||
}
|
||||
// public boolean hasAlreadyBeenOpened() {
|
||||
// return panel != null;
|
||||
// }
|
||||
|
||||
|
||||
public void updateStatusPanel(ContributionPanel contributionPanel) {
|
||||
statusPanel.update(contributionPanel);
|
||||
|
||||
@@ -73,8 +73,8 @@ class StatusPanel extends JPanel {
|
||||
label.setEditable(false);
|
||||
label.setOpaque(false);
|
||||
label.setContentType("text/html");
|
||||
bodyRule = "a, body { font-family: " + ContributionManagerDialog.myFont.getFamily() + "; " +
|
||||
"font-size: " + ContributionManagerDialog.myFont.getSize() + "pt; color: black; text-decoration: none;}";
|
||||
bodyRule = "a, body { font-family: " + ContributionManagerDialog.font.getFamily() + "; " +
|
||||
"font-size: " + ContributionManagerDialog.font.getSize() + "pt; color: black; text-decoration: none;}";
|
||||
label.addHyperlinkListener(new HyperlinkListener() {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,6 +31,8 @@ X https://github.com/processing/processing/pull/3820
|
||||
X after clicking 'install' it's still possible to click it again
|
||||
X https://github.com/processing/processing/issues/3806
|
||||
X https://github.com/processing/processing/pull/3817
|
||||
X CM list should be sortable by status and author name
|
||||
X https://github.com/processing/processing/issues/3608
|
||||
|
||||
jakub
|
||||
X Make preprocessor scope-aware
|
||||
@@ -38,6 +40,10 @@ X https://github.com/processing/processing/issues/3799
|
||||
X https://github.com/processing/processing/pull/3810
|
||||
_ auto-complete is broken on OS X
|
||||
_ https://github.com/processing/processing/issues/3812
|
||||
_ Hitting enter on code completion completes and then creates a new line
|
||||
_ https://github.com/processing/processing/issues/3741
|
||||
_ found thread deadlock issues preventing it from working on OS X
|
||||
_ ctrl-space first inserts space, then deletes it, with completion
|
||||
|
||||
|
||||
known issues
|
||||
@@ -52,10 +58,6 @@ _ mouse events (i.e. toggle breakpoint) seem to be firing twice
|
||||
|
||||
3.0 final
|
||||
_ https://github.com/processing/processing/milestones/3.0%20final
|
||||
_ Hitting enter on code completion completes and then creates a new line
|
||||
_ https://github.com/processing/processing/issues/3741
|
||||
_ found thread deadlock issues preventing it from working on OS X
|
||||
_ ctrl-space first inserts space, then deletes it, with completion
|
||||
_ Live error checking throws error when calling color() on a PGraphics
|
||||
_ https://github.com/processing/processing/issues/3762
|
||||
_ "color type detected! this shouldn't be happening! please report"
|
||||
@@ -66,10 +68,6 @@ _ or just change the documentation?
|
||||
_ Contributions Manager UI design
|
||||
_ https://github.com/processing/processing/issues/3482
|
||||
_ items still show up in "Recent" if they no longer exist (on startup)
|
||||
_ replace about screen (1x and 2x versions)
|
||||
_ change 'alpha' to correct name
|
||||
_ also change the revision in the "about processing" dialog
|
||||
_ https://github.com/processing/processing/issues/3665
|
||||
_ UnsatisfiedLinkError on startup "Access is denied" on Windows 10
|
||||
_ https://github.com/processing/processing/issues/3800
|
||||
_ administrator, but using Microsoft account to log in
|
||||
@@ -88,8 +86,6 @@ _ and if not, put up a warning for the user?
|
||||
_ http://www.oracle.com/us/technologies/java/locale-140624.html
|
||||
_ Red error underline is sometimes at wrong location
|
||||
_ https://github.com/processing/processing/issues/3759
|
||||
_ Examples window closes and re-opens during library install/remove
|
||||
_ https://github.com/processing/processing/issues/3304
|
||||
|
||||
|
||||
sketch modified externally (3.0 final)
|
||||
@@ -104,6 +100,21 @@ o use watcher service after all?
|
||||
o https://docs.oracle.com/javase/tutorial/essential/io/notification.html
|
||||
|
||||
|
||||
gui/James
|
||||
_ Fix placement and visual design when showing error on hover
|
||||
_ https://github.com/processing/processing/issues/3173
|
||||
_ import suggestions box needs design review
|
||||
_ https://github.com/processing/processing/issues/3407
|
||||
_ distinguish errors and warnings
|
||||
_ https://github.com/processing/processing/issues/3406
|
||||
_ make breakpoints more prominent
|
||||
_ https://github.com/processing/processing/issues/3307
|
||||
_ replace about screen (1x and 2x versions)
|
||||
_ change 'alpha' to correct name
|
||||
_ also change the revision in the "about processing" dialog
|
||||
_ https://github.com/processing/processing/issues/3665
|
||||
|
||||
|
||||
gui
|
||||
_ different design of squiggly line?
|
||||
_ build custom scroll bar since the OS versions are so ugly?
|
||||
@@ -111,14 +122,6 @@ _ error/warning location is awkward when no scroll bar is in use
|
||||
_ show hover text when the mouse is over the 'debug' button
|
||||
_ show number of updates available in the footer
|
||||
_ https://github.com/processing/processing/issues/3518
|
||||
_ make breakpoints more prominent
|
||||
_ https://github.com/processing/processing/issues/3307
|
||||
_ import suggestions box needs design review
|
||||
_ https://github.com/processing/processing/issues/3407
|
||||
_ Fix placement and visual design when showing error on hover
|
||||
_ https://github.com/processing/processing/issues/3173
|
||||
_ distinguish errors and warnings
|
||||
_ https://github.com/processing/processing/issues/3406
|
||||
_ finish the gui
|
||||
_ https://github.com/processing/processing/issues/3072
|
||||
_ see notes in the 'dialogs' section below, implement our own option panes?
|
||||
@@ -147,8 +150,16 @@ _ whether hitting ESC or the close box on the window
|
||||
|
||||
manager
|
||||
_ scrolling "past" top/bottom causes the screen to jiggle
|
||||
_ number of updates available is not correct
|
||||
_ retina icons show at twice the size and just crop at top/bottom
|
||||
_ total number of updates available is not correct
|
||||
_ implement 2x versions of icons
|
||||
_ https://github.com/processing/processing/issues/3478
|
||||
_ foundation icon in list
|
||||
_ foundation icon below next to description when lib selected
|
||||
_ icons on the install/update/remove buttons
|
||||
_ search eyeglass icon
|
||||
_
|
||||
_ Examples window closes and re-opens during library install/remove
|
||||
_ https://github.com/processing/processing/issues/3304
|
||||
|
||||
|
||||
fonts
|
||||
|
||||
Reference in New Issue
Block a user