com.alee.laf.panel.WebPanel Java Examples

The following examples show how to use com.alee.laf.panel.WebPanel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ShortcutInfoPanel.java    From lnk2pwn with MIT License 6 votes vote down vote up
@PostConstruct
private void initComponents() {		
    this.setLayout(new MigLayout("", "[grow]", ""));
    
    targetPathField.getDocument().addDocumentListener(this);
    workingDirField.getDocument().addDocumentListener(this);
    argumentsField.getDocument().addDocumentListener(this);
    shortcutFileNameField.getDocument().addDocumentListener(this);
    fakeExtensionField.getDocument().addDocumentListener(this);
    iconPathField.getDocument().addDocumentListener(this);
    iconIndexField.getDocument().addDocumentListener(this);
    
    targetPathField.setText(DEFAULT_TARGET_PATH);
    workingDirField.setText(DEFAULT_WORKING_DIR);
    argumentsField.setText(DEFAULT_ARGUMENTS);
    fakeExtensionField.setText(DEFAULT_FAKE_EXTENSION);
    iconPathField.setText(DEFAULT_ICON_DLL);
                    
    WebPanel targetAndWorkingDirPanel = createTargetPathAndWorkingDirPanel();
    WebPanel argumentsPanel = createArgumentsPanel();		
    WebPanel shortcutDetailsPanel = createShortcutDetailsPanel();
    
    this.add(targetAndWorkingDirPanel, "grow,wrap");
    this.add(argumentsPanel, "grow,wrap");		
    this.add(shortcutDetailsPanel, "grow,wrap");
}
 
Example #2
Source File: TabbedEffectDialog.java    From Spade with GNU General Public License v3.0 6 votes vote down vote up
public TabbedEffectDialog(int panes, String title, ImageIcon icon)
{
	dialog = new WebDialog(Spade.main.gui.frame, title);
	if(icon != null)
		dialog.setIconImage(icon.getImage());
	dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
	dialog.setAlwaysOnTop(true);
	dialog.setAutoRequestFocus(true);
	dialog.setShowResizeCorner(false);
	
	panels = new WebPanel[panes];
	JPanel panel = (JPanel) dialog.getContentPane();
	panel.setLayout(new BorderLayout());
	
	tabs = new WebTabbedPane();
	tabs.setTabStretchType(TabStretchType.always);
	panel.add(tabs, BorderLayout.CENTER);
	
	for(int i = 0; i < panes; i++)
	{
		tabs.add(panels[i] = new WebPanel());
	}
	
	bottom = new WebPanel();
	panel.add(bottom, BorderLayout.SOUTH);
}
 
Example #3
Source File: UACBypassPanel.java    From lnk2pwn with MIT License 6 votes vote down vote up
private WebPanel createUACCommandPanel() {
    MigLayout layout = new MigLayout("", "[grow][grow]", "[][grow]");
    WebPanel panel = new WebPanel();
    panel.setLayout(layout);
    panel.add(new WebLabel("Command"));
    panel.add(new WebLabel("Output"), "wrap");
                    
    uacCommandTextArea.setLineWrap(true);
    uacCommandTextArea.setBackground(COMMAND_BG_COLOR);
    uacCommandTextArea.setForeground(Color.WHITE);
    
    uacOuputTextArea.setLineWrap(true);
    uacOuputTextArea.setBackground(COMMAND_BG_COLOR);
    uacOuputTextArea.setForeground(Color.WHITE);
    
    WebScrollPane uacCommandAreaScroll = new WebScrollPane(uacCommandTextArea);		
    WebScrollPane uacOuputAreaScroll = new WebScrollPane(uacOuputTextArea);
    
    panel.add(uacCommandAreaScroll, "w 100%, h 100%, hmin 250");
    panel.add(uacOuputAreaScroll, "w 100%, h 100%, hmin 250");
    
    return panel;
}
 
Example #4
Source File: TabPanelMaintenance.java    From mars-sim with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Populates the malfunctions list.
 */
private void populateMalfunctionsList() {
	// Clear the list.
	malfunctionsListPanel.removeAll();

	// Populate the list.
	if (malfunctionsList == null)
		malfunctionsList = new ArrayList<Malfunction>();
	else
		malfunctionsList.clear();
	Iterator<Building> i = settlement.getBuildingManager().getBuildings().iterator();// getACopyOfBuildings().iterator();.getACopyOfBuildings().iterator();
	while (i.hasNext()) {
		Building building = i.next();
		Iterator<Malfunction> j = building.getMalfunctionManager().getMalfunctions().iterator();
		while (j.hasNext()) {
			Malfunction malfunction = j.next();
			malfunctionsList.add(malfunction);
			WebPanel panel = new BuildingMalfunctionPanel(malfunction, building);
			malfunctionsListPanel.add(panel);
		}
	}
}
 
Example #5
Source File: MainFrame.java    From desktopclient-java with GNU General Public License v3.0 6 votes vote down vote up
private void showAboutDialog() {
    WebPanel aboutPanel = new WebPanel(new GridLayout(0, 1, View.GAP_SMALL, View.GAP_SMALL));
    aboutPanel.add(new WebLabel("Kontalk Java Client v" + Kontalk.VERSION));
    WebLinkLabel linkLabel = new WebLinkLabel();
    linkLabel.setLink(View.KONTALK_SITE);
    linkLabel.setText(Tr.tr("Visit kontalk.org"));
    aboutPanel.add(linkLabel);
    WebLabel soundLabel = new WebLabel(Tr.tr("Notification sound by")+" FxProSound");
    aboutPanel.add(soundLabel);
    Icon icon = Utils.getIcon("kontalk.png");
    WebOptionPane.showMessageDialog(this,
            aboutPanel,
            Tr.tr("About"),
            WebOptionPane.INFORMATION_MESSAGE,
            icon);
}
 
Example #6
Source File: ComponentUtils.java    From desktopclient-java with GNU General Public License v3.0 6 votes vote down vote up
ModalPopup(AbstractButton invokerButton) {
    mInvoker = invokerButton;

    layerPanel = new WebPanel();
    layerPanel.setOpaque(false);

    JRootPane rootPane = SwingUtils.getRootPane(mInvoker);
    if (rootPane == null) {
        throw new IllegalStateException("not on UI start, dummkopf!");
    }
    installPopupLayer(layerPanel, rootPane);
    layerPanel.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            ModalPopup.this.close();
        }
    });

    this.setRequestFocusOnShow(false);
}
 
Example #7
Source File: WebPanelExample.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
@NotNull
@Override
protected List<? extends JComponent> createPreviewElements ()
{
    final WebPanel panel = new WebPanel ( getStyleId (), new BorderLayout ( 15, 15 ) );
    panel.setPadding ( 15 );
    panel.add ( new WebLabel ( DemoStyles.placeholderLabel, "NORTH", WebLabel.CENTER ), BorderLayout.NORTH );
    panel.add ( new WebLabel ( DemoStyles.placeholderLabel, "EAST" ), BorderLayout.EAST );
    panel.add ( new WebLabel ( DemoStyles.placeholderLabel, "SOUTH", WebLabel.CENTER ), BorderLayout.SOUTH );
    panel.add ( new WebLabel ( DemoStyles.placeholderLabel, "WEST" ), BorderLayout.WEST );
    panel.add ( new WebButton ( "CENTER" ), BorderLayout.CENTER );
    return CollectionUtils.asList ( panel );
}
 
Example #8
Source File: FormPanel.java    From lnk2pwn with MIT License 5 votes vote down vote up
private WebPanel createGenerateButtonPanel() {
    MigLayout layout = new MigLayout("", "[grow]", "");
    WebPanel panel = new WebPanel();
    panel.setLayout(layout);
    panel.add(generateButton, "east");
            
    return panel;
}
 
Example #9
Source File: SampleInterface.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns sample auth form UI.
 *
 * @return sample auth form UI
 */
@NotNull
public static JComponent createAuthForm ()
{
    final WebPanel form = new WebPanel ( StyleId.panelDecorated, new FormLayout ( 10, 10 ) );
    form.setPadding ( 15, 25, 15, 25 );

    form.add ( new WebStyledLabel ( "demo.sample.interface.auth.title", SwingConstants.CENTER ), FormLayout.LINE );

    form.add ( new WebLabel ( "demo.sample.interface.auth.login", SwingConstants.RIGHT ) );
    form.add ( new WebTextField ( 15 ) );

    form.add ( new WebLabel ( "demo.sample.interface.auth.password", SwingConstants.RIGHT ) );
    form.add ( new WebPasswordField ( 15 ) );

    form.add ( new AlignPanel (
            new GroupPanel (
                    5, true,
                    new WebButton ( "demo.sample.interface.auth.buttons.login" ).setPreferredWidth ( 100 ),
                    new WebButton ( "demo.sample.interface.auth.buttons.cancel" ).setPreferredWidth ( 100 )
            ),
            AlignPanel.CENTER,
            AlignPanel.CENTER
    ), FormLayout.LINE );

    return form;
}
 
Example #10
Source File: ExplorationCustomInfoPanel.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Constructor
 * @param siteName the site name.
 * @param completion the completion level.
 */
ExplorationSitePanel(String siteName, double completion) {
	// Use JPanel constructor.
	super();

	this.completion = completion;

	setLayout(new GridLayout(1, 2, 3, 3));

	WebPanel namePanel = new WebPanel(new FlowLayout(FlowLayout.RIGHT, 3, 3));
	namePanel.setAlignmentX(CENTER_ALIGNMENT);
	add(namePanel);

	WebLabel nameLabel = new WebLabel("  " + Conversion.capitalize(siteName), SwingConstants.RIGHT);
	nameLabel.setAlignmentX(CENTER_ALIGNMENT);
	namePanel.add(nameLabel);

	WebPanel barPanel = new WebPanel(new FlowLayout(FlowLayout.LEFT, 3, 0));
	barPanel.setAlignmentX(CENTER_ALIGNMENT);
	add(barPanel);

	completionBar = new WebProgressBar(0, 100);
	completionBar.setAlignmentX(CENTER_ALIGNMENT);
	completionBar.setStringPainted(true);
	completionBar.setValue((int) (completion * 100D));
	barPanel.add(completionBar);
}
 
Example #11
Source File: AboutLibraryDialog.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns java version panel.
 *
 * @return java version panel
 */
@NotNull
private WebPanel createJavaVersionPanel ()
{
    final WebImage javaIcon = new WebImage ( new LazyIcon ( "java32" ) );

    final WebLink javaVersion = new WebLink ();
    javaVersion.setLanguage ( "weblaf.about.dialog.general.java.version", SystemUtils.getJavaVersionString () );
    javaVersion.addAction ( new UrlLinkAction ( "http://www.oracle.com/technetwork/java/javase/overview/" ) );
    javaVersion.setBoldFont ();

    final WebLabel javaName = new WebLabel ( SystemUtils.getJavaName () );

    return new GroupPanel ( StyleId.panelTransparent, 15, javaIcon, new GroupPanel ( false, javaVersion, javaName ) );
}
 
Example #12
Source File: AboutLibraryDialog.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns general tab content.
 *
 * @return general tab content
 */
@NotNull
private Component createGeneralTab ()
{
    final WebPanel content = new WebPanel ( StyleId.of ( "general" ), new VerticalFlowLayout ( 30, 30 ) );
    content.add ( createLibraryVersionPanel () );
    content.add ( new WebSeparator ( WebSeparator.HORIZONTAL ) );
    content.add ( createJavaVersionPanel () );
    content.add ( new WebSeparator ( WebSeparator.HORIZONTAL ) );
    content.add ( createOsVersionPanel () );
    return content;
}
 
Example #13
Source File: NotesTabPanel.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
public void initializeUI() {
	uiDone = true;
	
	// Initialize location header.
	WebPanel titlePane = new WebPanel(new FlowLayout(FlowLayout.CENTER));
	topContentPanel.add(titlePane);

	WebLabel titleLabel = new WebLabel(Msg.getString("NotesTabPanel.title"), WebLabel.CENTER); //$NON-NLS-1$
	titleLabel.setFont(new Font("Serif", Font.BOLD, 16));
	// titleLabel.setForeground(new Color(102, 51, 0)); // dark brown
	titlePane.add(titleLabel);
	
	// Create notes panel
	WebPanel notesPanel = new WebPanel(new BorderLayout(5, 5));
	notesPanel.setBorder(new MarsPanelBorder());
	notesPanel.setBorder(new EmptyBorder(1, 1, 1, 1));
	centerContentPanel.add(notesPanel);
	
	notesCache = unit.getNotes();
	
	textArea = new WebTextArea(StyleId.textareaDecorated);
	notesPanel.add(textArea);
	
	if (notesCache == null || notesCache.equals(""))
		textArea.setInputPrompt("Enter Here");
	else {
		textArea.append(notesCache);
	}

}
 
Example #14
Source File: TabPanelBuildings.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
public void setPanelTranslucent() {
	// if (isTranslucent) {
	Iterator<WebPanel> i = panelList.iterator();
	while (i.hasNext()) {
		WebPanel pp = i.next();
		setPanelStyle(pp);
	}
	// }
}
 
Example #15
Source File: WebLafWikiPage.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
@Override
public JComponent createLink ()
{
    final WebPanel link = new WebPanel ( StyleId.panelTransparent, new HorizontalFlowLayout ( 4, false ) );
    link.add ( new WebLabel ( DemoStyles.wikiLabel, "demo.content.example.wiki.weblaf", DemoIcons.github16 ) );
    link.add ( new WebLink ( DemoStyles.wikiLink, getTitle (), new UrlLinkAction ( getAddress () ) ) );
    return link;
}
 
Example #16
Source File: WebTitledPanel.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
public WebTitledPanel ()
{
    super ( StyleId.panelDecorated );
    //        setWebColoredBackground ( false );

    title = new WebPanel ( StyleId.panelDecorated );
    //        title.setPaintSides ( false, false, true, false );
    //        title.setMargin ( 0 );
    //        title.setShadeWidth ( 0 );
    add ( title, BorderLayout.NORTH );

    content = new WebPanel ();
    content.setMargin ( 0 );
    add ( content, BorderLayout.CENTER );
}
 
Example #17
Source File: WebDockablePaneUI.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Installs UI elements.
 */
protected void installComponents ()
{
    emptyContent = new WebPanel ( StyleId.dockablepaneEmpty.at ( pane ) );
    if ( pane.getContent () == null )
    {
        pane.setContent ( emptyContent );
    }
}
 
Example #18
Source File: ShortcutInfoPanel.java    From lnk2pwn with MIT License 5 votes vote down vote up
private WebPanel createTargetPathAndWorkingDirPanel() {
    MigLayout layout = new MigLayout("", "[grow][grow]", "");
    WebPanel panel = new WebPanel();
    panel.setLayout(layout);
    panel.add(new WebLabel("Target Path"));
    panel.add(new WebLabel("Working Dir"), "wrap");
    panel.add(targetPathField, "grow");			
    panel.add(workingDirField, "grow");
    return panel;
}
 
Example #19
Source File: ExplorationSitesPanel.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
		int row, int column) {

	if ((value != null) && (value instanceof Color)) {
		Color color = (Color) value;
		WebPanel colorPanel = new WebPanel();
		colorPanel.setOpaque(true);
		colorPanel.setBackground(color);
		return colorPanel;
	} else
		return null;

}
 
Example #20
Source File: MiningSitePanel.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
		int row, int column) {

	if ((value != null) && (value instanceof Color)) {
		Color color = (Color) value;
		WebPanel colorPanel = new WebPanel();
		colorPanel.setOpaque(true);
		colorPanel.setBackground(color);
		return colorPanel;
	} else
		return null;

}
 
Example #21
Source File: WebColorChooserPanel.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
private WebPanel getButtonsPanel ()
{
    if ( buttonsPanel == null )
    {
        buttonsPanel = createButtonsPanel ();
    }
    return buttonsPanel;
}
 
Example #22
Source File: WebPopOverExample.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
@NotNull
@Override
protected List<? extends JComponent> createPreviewElements ()
{
    final WebButton button = new WebButton ( getExampleLanguagePrefix () + "show" );
    button.addActionListener ( new ActionListener ()
    {
        @Override
        public void actionPerformed ( final ActionEvent e )
        {
            final Window parent = CoreSwingUtils.getNonNullWindowAncestor ( button );
            final WebPopOver popOver = new WebPopOver ( getStyleId (), parent );
            popOver.setIconImages ( WebLookAndFeel.getImages () );
            popOver.setCloseOnFocusLoss ( true );
            popOver.setPadding ( 10 );

            final WebPanel container = new WebPanel ( StyleId.panelTransparent, new BorderLayout ( 5, 5 ) );

            final WebLabel label = new WebLabel ( getExampleLanguagePrefix () + "label", WebLabel.CENTER );
            container.add ( label, BorderLayout.NORTH );

            final String text = LM.get ( getExampleLanguagePrefix () + "text" );
            final WebTextField field = new WebTextField ( text, 20 );
            field.setHorizontalAlignment ( WebTextField.CENTER );
            container.add ( field, BorderLayout.CENTER );

            popOver.add ( container );

            popOver.show ( button, PopOverDirection.down );
        }
    } );
    return CollectionUtils.asList ( button );
}
 
Example #23
Source File: StyleEditor.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Initializes single component preview.
 *
 * @param title         preview title
 * @param styleId       {@link StyleId}
 * @param displayedView displayed view
 * @param view          view
 * @param center        whether or not should center view
 */
protected void addViewComponent ( final String title, final StyleId styleId, final JComponent displayedView, final JComponent view,
                                  final boolean center )
{
    final ComponentDescriptor descriptor = StyleManager.getDescriptor ( view );

    final StyleId singleId = StyleId.styleeditorPreviewSingle.at ( previewPanel );
    final WebPanel singlePreview = new WebPanel ( singleId, new BorderLayout ( 0, 0 ) );

    final ChildStyleId titleId = StyleId.styleeditorPreviewSingleTitle;
    final WebLabel titleLabel = new WebLabel ( titleId.at ( singlePreview ), title, descriptor.getIcon (), WebLabel.LEADING );
    singlePreview.add ( titleLabel, BorderLayout.NORTH );

    final StyleId emptyId = StyleId.styleeditorPreviewSingleEmpty.at ( singlePreview );
    final WebPanel boundsPanel = new WebPanel ( emptyId, displayedView );
    boundsPanel.putClientProperty ( SINGLE_PREVIEW_KEY, singlePreview );
    boundsPanels.add ( boundsPanel );

    final StyleId viewId = StyleId.styleeditorPreviewSingleShadow.at ( singlePreview );
    final WebPanel viewPanel = new WebPanel ( viewId, center ? new CenterPanel ( boundsPanel ) : boundsPanel );
    singlePreview.add ( viewPanel, BorderLayout.CENTER );

    singlePreview.putClientProperty ( COMPONENT_DESCRIPTOR_KEY, descriptor );
    singlePreview.putClientProperty ( STYLE_ID_KEY, styleId != null ? styleId : StyleManager.getStyleId ( view ) );

    titleLabel.addMouseListener ( new MouseAdapter ()
    {
        @Override
        public void mousePressed ( final MouseEvent e )
        {
            viewPanel.setVisible ( !viewPanel.isVisible () );
            previewPanel.revalidate ();
            previewPanel.repaint ();
        }
    } );

    previewPanel.add ( singlePreview );
    previewComponents.add ( view );
}
 
Example #24
Source File: WebFileChooserPanel.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns center panel content.
 *
 * @return center panel content
 */
protected Component createContent ()
{
    // todo Context menu for view components
    //----------------
    //- Select file(s) -if filter allows
    //- folder up -if not top
    //----------------
    //- delete
    //- new folder
    //- rename
    //- refresh
    //----------------
    //- view(if viewable image)/run(if runnable)/open(if folder)
    //- edit
    //----------------
    //- view
    //----------------

    centralContainer = new WebPanel ( StyleId.filechooserCenterPanel.at ( this ), new BorderLayout ( 4, 0 ) );

    centralSplit = new WebSplitPane ( StyleId.filechooserCenterSplit.at ( centralContainer ), WebSplitPane.HORIZONTAL_SPLIT );
    centralSplit.setOneTouchExpandable ( true );

    createFileTree ();
    createFileList ();
    createFileTable ();

    centralSplit.setLeftComponent ( treeScroll );
    centralSplit.setRightComponent ( fileListScroll );
    centralSplit.setDividerLocation ( dividerLocation );

    centralContainer.add ( centralSplit );

    return centralContainer;
}
 
Example #25
Source File: View.java    From desktopclient-java with GNU General Public License v3.0 5 votes vote down vote up
void showPasswordDialog(boolean wasWrong) {
    WebPanel passPanel = new WebPanel();
    WebLabel passLabel = new WebLabel(Tr.tr("Please enter your key password:"));
    passPanel.add(passLabel, BorderLayout.NORTH);
    final WebPasswordField passField = new WebPasswordField();
    passPanel.add(passField, BorderLayout.CENTER);
    if (wasWrong) {
        WebLabel wrongLabel = new WebLabel(Tr.tr("Wrong password"));
        wrongLabel.setForeground(Color.RED);
        passPanel.add(wrongLabel, BorderLayout.SOUTH);
    }
    WebOptionPane passPane = new WebOptionPane(passPanel,
            WebOptionPane.QUESTION_MESSAGE,
            WebOptionPane.OK_CANCEL_OPTION);
    JDialog dialog = passPane.createDialog(mMainFrame, Tr.tr("Enter password"));
    dialog.setModal(true);
    dialog.addWindowFocusListener(new WindowAdapter() {
        @Override
        public void windowGainedFocus(WindowEvent e) {
            passField.requestFocusInWindow();
        }
    });
    // blocking
    LOGGER.info("asking for password…");
    dialog.setVisible(true);

    Object value = passPane.getValue();
    if (value != null && value.equals(WebOptionPane.OK_OPTION))
        mControl.connect(passField.getPassword());
}
 
Example #26
Source File: Notifier.java    From desktopclient-java with GNU General Public License v3.0 5 votes vote down vote up
void showPresenceError(Contact contact, RosterHandler.Error error) {
    WebPanel panel = panel(Tr.tr("Contact error"), contact);

    panel.add(new WebLabel(Tr.tr("Error:")).setBoldFont());
    String errorText = Tr.tr(error.toString());
    switch (error) {
        case SERVER_NOT_FOUND:
            errorText = Tr.tr("Server not found");
            break;
    }

    panel.add(textArea(errorText));

    NotificationManager.showNotification(mWindow, panel, NotificationOption.cancel);
}
 
Example #27
Source File: Notifier.java    From desktopclient-java with GNU General Public License v3.0 5 votes vote down vote up
void confirmNewKey(final Contact contact, final PGPUtils.PGPCoderKey key) {
     final boolean overwriting = contact.hasKey();

    WebPanel panel = panel(overwriting ?
            Tr.tr("Received a new public key for contact") :
            Tr.tr("Public key for contact was found"), contact);

    panel.add(new WebLabel(Tr.tr("Key fingerprint:")));
    WebTextArea fpArea = Utils.createFingerprintArea();
    fpArea.setText(Utils.fingerprint(key.fingerprint));
    panel.add(fpArea);

    String expl = overwriting ?
            Tr.tr("When declining the key, communication with this contact will be blocked.") :
            Tr.tr("When accepting the key, communication with this contact will be encrypted.");
    panel.add(textArea(expl));

    WebNotificationPopup popup = NotificationManager.showNotification(mWindow, panel,
            NotificationOption.accept, NotificationOption.decline,
            NotificationOption.cancel);
    popup.setClickToClose(false);
    popup.addNotificationListener(new NotificationListener() {
        @Override
        public void optionSelected(NotificationOption option) {
            switch (option) {
                case accept :
                    mView.getControl().acceptKey(contact, key);
                    break;
                case decline :
                    if (overwriting)
                         mView.getControl().declineKey(contact);
            }
        }
        @Override
        public void accepted() {}
        @Override
        public void closed() {}
    });
}
 
Example #28
Source File: AboutLibraryDialog.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns operation system version panel.
 *
 * @return operation system version panel
 */
@NotNull
private WebPanel createOsVersionPanel ()
{
    final WebImage osIcon = new WebImage ( SystemUtils.getOsIcon ( 32, false ) );

    final WebLink version = new WebLink ( SystemUtils.getOsName (), new UrlLinkAction ( SystemUtils.getOsSite () ) );
    version.setBoldFont ();

    final WebLabel osVersion = new WebLabel ();
    osVersion.setLanguage ( "weblaf.about.dialog.general.os.arch", SystemUtils.getOsArch () );

    return new GroupPanel ( StyleId.panelTransparent, 15, osIcon, new GroupPanel ( false, version, osVersion ) );
}
 
Example #29
Source File: Notifier.java    From desktopclient-java with GNU General Public License v3.0 5 votes vote down vote up
void confirmSubscription(ViewEvent.SubscriptionRequest event){
    final Contact contact = event.contact;

    WebPanel panel = panel(Tr.tr("Authorization request"), contact);

    String expl = Tr.tr("When accepting, this contact will be able to see your online status.");
    panel.add(textArea(expl));

    WebNotificationPopup popup = NotificationManager.showNotification(mWindow, panel,
            NotificationOption.accept, NotificationOption.decline,
            NotificationOption.cancel);
    popup.setClickToClose(false);
    popup.addNotificationListener(new NotificationListener() {
        @Override
        public void optionSelected(NotificationOption option) {
            switch (option) {
                case accept :
                    mView.getControl().sendSubscriptionResponse(contact, true);
                    break;
                case decline :
                    mView.getControl().sendSubscriptionResponse(contact, false);
            }
        }
        @Override
        public void accepted() {}
        @Override
        public void closed() {}
    });
}
 
Example #30
Source File: GridEffectDialog.java    From Spade with GNU General Public License v3.0 5 votes vote down vote up
public GridEffectDialog(int cols, int rows, String title, ImageIcon icon)
{
	this.dialog = new WebDialog(Spade.main.gui.frame, title);
	if(icon != null)
		dialog.setIconImage(icon.getImage());
	dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
	dialog.setAlwaysOnTop(true);
	dialog.setAutoRequestFocus(true);
	dialog.setShowResizeCorner(false);
	
	panels = new JPanel[rows * cols];
	
	JPanel pane = (JPanel) dialog.getContentPane();
	
	WebPanel panel = new WebPanel();
	panel.setLayout(new GridLayout(rows, cols));
	
	for(int i = 0; i < cols * rows; i++)
	{
		panel.add(panels[i] = new WebPanel());
	}
	
	bottom = new WebPanel();
	
	pane.add(panel, BorderLayout.CENTER);
	pane.add(bottom, BorderLayout.SOUTH);
}