mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 02:45:36 +01:00
clean up method naming/parameters/overrides
This commit is contained in:
@@ -93,7 +93,7 @@ public class ContributionTab extends JPanel {
|
||||
};
|
||||
|
||||
contribListing = ContributionListing.getInstance();
|
||||
statusPanel = new StatusPanel(650, this);
|
||||
statusPanel = new StatusPanel(this, 650);
|
||||
contributionListPanel = new ListPanel(this, filter);
|
||||
contribListing.addListener(contributionListPanel);
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public class ContributionTab extends JPanel {
|
||||
public void showFrame(final Editor editor, boolean error, boolean loading) {
|
||||
this.editor = editor;
|
||||
|
||||
setLayout(editor, error, loading);
|
||||
setLayout(error, loading);
|
||||
contributionListPanel.setVisible(!loading);
|
||||
loaderLabel.setVisible(loading);
|
||||
errorPanel.setVisible(error);
|
||||
@@ -117,7 +117,7 @@ public class ContributionTab extends JPanel {
|
||||
}
|
||||
|
||||
|
||||
protected void setLayout(final Editor editor, boolean activateErrorPanel,
|
||||
protected void setLayout(boolean activateErrorPanel,
|
||||
boolean isLoading) {
|
||||
if (progressBar == null) {
|
||||
progressBar = new JProgressBar();
|
||||
|
||||
@@ -580,6 +580,7 @@ implements Scrollable, ContributionListing.ChangeListener {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredScrollableViewportSize() {
|
||||
return getPreferredSize();
|
||||
}
|
||||
@@ -588,6 +589,7 @@ implements Scrollable, ContributionListing.ChangeListener {
|
||||
/**
|
||||
* Amount to scroll to reveal a new page of items
|
||||
*/
|
||||
@Override
|
||||
public int getScrollableBlockIncrement(Rectangle visibleRect,
|
||||
int orientation, int direction) {
|
||||
if (orientation == SwingConstants.VERTICAL) {
|
||||
@@ -609,6 +611,7 @@ implements Scrollable, ContributionListing.ChangeListener {
|
||||
/**
|
||||
* Amount to scroll to reveal the rest of something we are on or a new item
|
||||
*/
|
||||
@Override
|
||||
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) {
|
||||
if (orientation == SwingConstants.VERTICAL) {
|
||||
int lastHeight = 0, height = 0;
|
||||
@@ -647,17 +650,19 @@ implements Scrollable, ContributionListing.ChangeListener {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean getScrollableTracksViewportHeight() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean getScrollableTracksViewportWidth() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public int getNoOfRows() {
|
||||
public int getRowCount() {
|
||||
return panelByContribution.size();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class StatusPanel extends JPanel {
|
||||
public StatusPanel() { }
|
||||
|
||||
|
||||
public StatusPanel(int width, final ContributionTab contributionTab) {
|
||||
public StatusPanel(final ContributionTab contributionTab, int width) {
|
||||
this.contributionTab = contributionTab;
|
||||
|
||||
if (foundationIcon == null) {
|
||||
|
||||
@@ -6,7 +6,6 @@ import javax.swing.GroupLayout;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JProgressBar;
|
||||
|
||||
import processing.app.ui.Editor;
|
||||
import processing.app.ui.Toolkit;
|
||||
|
||||
|
||||
@@ -26,15 +25,14 @@ public class UpdateContributionTab extends ContributionTab {
|
||||
}
|
||||
};
|
||||
contributionListPanel = new UpdateListPanel(this, filter);
|
||||
statusPanel = new UpdateStatusPanel(this, 650, this);
|
||||
statusPanel = new UpdateStatusPanel(this, 650);
|
||||
contribListing = ContributionListing.getInstance();
|
||||
contribListing.addListener(contributionListPanel);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void setLayout(Editor editor, boolean activateErrorPanel,
|
||||
boolean isLoading) {
|
||||
protected void setLayout(boolean error, boolean loading) {
|
||||
if (progressBar == null) {
|
||||
progressBar = new JProgressBar();
|
||||
progressBar.setVisible(false);
|
||||
@@ -43,7 +41,7 @@ public class UpdateContributionTab extends ContributionTab {
|
||||
|
||||
loaderLabel = new JLabel(Toolkit.getLibIcon("icons/loader.gif"));
|
||||
loaderLabel.setOpaque(false);
|
||||
loaderLabel.setBackground(Color.WHITE);
|
||||
// loaderLabel.setBackground(Color.WHITE);
|
||||
}
|
||||
|
||||
GroupLayout layout = new GroupLayout(this);
|
||||
|
||||
@@ -15,14 +15,9 @@ import processing.app.ui.Toolkit;
|
||||
|
||||
public class UpdateStatusPanel extends StatusPanel {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private final UpdateContributionTab parent;
|
||||
|
||||
public UpdateStatusPanel(UpdateContributionTab updateContributionTab, int width, final ContributionTab contributionTab) {
|
||||
public UpdateStatusPanel(UpdateContributionTab tab, int width) {
|
||||
super();
|
||||
parent = updateContributionTab;
|
||||
this.contributionTab = tab;
|
||||
|
||||
updateButton = new JButton("Update All", Toolkit.getLibIconX("manager/update"));
|
||||
updateButton.setFont(Toolkit.getSansFont(14, Font.PLAIN));
|
||||
@@ -56,6 +51,6 @@ public class UpdateStatusPanel extends StatusPanel {
|
||||
}
|
||||
|
||||
public void update() {
|
||||
updateButton.setEnabled(parent.contributionListPanel.getNoOfRows() > 0);
|
||||
updateButton.setEnabled(contributionTab.contributionListPanel.getRowCount() > 0);
|
||||
}
|
||||
}
|
||||
9
todo.txt
9
todo.txt
@@ -131,8 +131,15 @@ _ mouse events (i.e. toggle breakpoint) seem to be firing twice
|
||||
|
||||
|
||||
beta 7
|
||||
_ CM selected tabs are too tall
|
||||
X CM selected tabs are too tall
|
||||
_ https://github.com/processing/processing/issues/3598
|
||||
_ why the aqua background when opening the window?
|
||||
_ list with contrib types separated is really wonky
|
||||
_ do we keep the list?
|
||||
_ does it even work for different contrib types?
|
||||
_ bring back the # of updates on each tab
|
||||
_ use this instead of the 'icon' stuff
|
||||
|
||||
_ show number of updates available in the footer
|
||||
_ https://github.com/processing/processing/issues/3518
|
||||
_ and have it be clickable so to open the manager
|
||||
|
||||
Reference in New Issue
Block a user