use of javax.swing.ImageIcon in project EnrichmentMapApp by BaderLab.
the class SwingUtil method resizeIcon.
public static ImageIcon resizeIcon(final ImageIcon icon, int width, int height) {
final Image img = icon.getImage().getScaledInstance(width, height, Image.SCALE_AREA_AVERAGING);
final BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
final Graphics2D g = bi.createGraphics();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.drawImage(img, 0, 0, width, height, null);
g.dispose();
return new ImageIcon(bi);
}
use of javax.swing.ImageIcon in project zaproxy by zaproxy.
the class RequestSplitComponent method initUi.
protected void initUi() {
buttonShowView = new JToggleButton(DisplayUtils.getScaledIcon(new ImageIcon(RequestSplitComponent.class.getResource("/resource/icon/view_split.png"))));
buttonShowView.setToolTipText(BUTTON_TOOL_TIP);
panelOptions = new JPanel();
panelOptions.add(headerViews.getSelectableViewsComponent());
panelOptions.add(bodyViews.getSelectableViewsComponent());
headerViews.addView(createHttpPanelHeaderTextView());
splitMain = new JSplitPane();
splitMain.setDividerSize(3);
splitMain.setResizeWeight(0.5d);
splitMain.setContinuousLayout(false);
splitMain.setOrientation(JSplitPane.VERTICAL_SPLIT);
splitMain.setTopComponent(headerViews.getViewsPanel());
splitMain.setBottomComponent(bodyViews.getViewsPanel());
initViews();
panelMain = new JPanel(new BorderLayout());
panelMain.add(splitMain, BorderLayout.CENTER);
setSelected(false);
}
use of javax.swing.ImageIcon in project zaproxy by zaproxy.
the class SearchPanel method getBtnNext.
private JButton getBtnNext() {
if (btnNext == null) {
btnNext = new JButton();
btnNext.setText(Constant.messages.getString("search.toolbar.label.next"));
// 'arrow down' icon
btnNext.setIcon(new ImageIcon(SearchPanel.class.getResource("/resource/icon/16/107.png")));
btnNext.setToolTipText(Constant.messages.getString("search.toolbar.tooltip.next"));
DisplayUtils.scaleIcon(btnNext);
btnNext.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent e) {
highlightNextResult();
}
});
}
return btnNext;
}
use of javax.swing.ImageIcon in project zaproxy by zaproxy.
the class SearchPanel method initialize.
/**
* This method initializes this
*/
private void initialize() {
resultsModel = new SearchResultsTableModel();
resultsTable = new SearchResultsTable(resultsModel);
resultsTable.setName(HTTP_MESSAGE_CONTAINER_NAME);
resultsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent evt) {
if (!evt.getValueIsAdjusting()) {
SearchResult searchResult = resultsTable.getSelectedSearchResult();
if (searchResult == null) {
return;
}
displayMessage(resultsTable.getSelectedSearchResult());
// Get the focus back so that the arrow keys work
resultsTable.requestFocusInWindow();
}
}
});
this.setLayout(new CardLayout());
//this.setSize(474, 251);
this.setName(Constant.messages.getString("search.panel.title"));
// 'magnifying glass' icon
this.setIcon(new ImageIcon(SearchPanel.class.getResource("/resource/icon/16/049.png")));
this.add(getPanelCommand(), getPanelCommand().getName());
this.setShowByDefault(true);
}
use of javax.swing.ImageIcon in project zaproxy by zaproxy.
the class SearchPanel method getScopeButton.
private JToggleButton getScopeButton() {
if (scopeButton == null) {
scopeButton = new ZapToggleButton();
scopeButton.setIcon(new ImageIcon(SearchPanel.class.getResource("/resource/icon/fugue/target-grey.png")));
scopeButton.setToolTipText(Constant.messages.getString("search.toolbar.tooltip.scope.unselected"));
scopeButton.setSelectedIcon(new ImageIcon(SearchPanel.class.getResource("/resource/icon/fugue/target.png")));
scopeButton.setSelectedToolTipText(Constant.messages.getString("search.toolbar.tooltip.scope.selected"));
DisplayUtils.scaleIcon(scopeButton);
scopeButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent e) {
extension.setSearchJustInScope(scopeButton.isSelected());
}
});
}
return scopeButton;
}
Aggregations