• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IconFontSwing类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中jiconfont.swing.IconFontSwing的典型用法代码示例。如果您正苦于以下问题:Java IconFontSwing类的具体用法?Java IconFontSwing怎么用?Java IconFontSwing使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

IconFontSwing类属于jiconfont.swing包,在下文中一共展示了IconFontSwing类的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: resetButtons

点赞 3

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
void resetButtons(){
	agendaB.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.CLASS, 48, ColorMap.ICON));
	agendaB.setBackground(ColorMap.WORKBACKGROUND);
	agendaB.setForeground(ColorMap.ICON);
	agendaB.setOpaque(false);
	eventsB.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.WATCH_LATER, 48, ColorMap.ICON));
	eventsB.setBackground(ColorMap.WORKBACKGROUND);
	eventsB.setForeground(ColorMap.ICON);
	eventsB.setOpaque(false);
	notesB.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.NOTE, 48, ColorMap.ICON));
	notesB.setBackground(ColorMap.WORKBACKGROUND);
	notesB.setForeground(ColorMap.ICON);
	notesB.setOpaque(false);
	tasksB.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.VIEW_LIST, 48, ColorMap.ICON));
	tasksB.setBackground(ColorMap.WORKBACKGROUND);
	tasksB.setForeground(ColorMap.ICON);
	tasksB.setOpaque(false);
	filesB.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.FOLDER, 48, ColorMap.ICON));
	filesB.setBackground(ColorMap.WORKBACKGROUND);
	filesB.setForeground(ColorMap.ICON);
	filesB.setOpaque(false);
}
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:23,
代码来源:WorkPanel.java

示例2: PopupDesktopNotification

点赞 3

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
public PopupDesktopNotification(String title, String text) {
  super();
  this.setTitle(title);
  try {
    jbInit();
    pack();
  }
  catch(Exception ex) {
    new ExceptionDialog(ex);
  }
  timeLabel.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.WATCH_LATER, 48, ColorMap.ICON));
  textLabel.setText(text);
  this.setSize(300,200);
  this.setLocationRelativeTo(null);
  this.setVisible(true);    
  this.toFront();
  this.requestFocus();
  //jButton1.requestFocus();
}
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:20,
代码来源:PopupDesktopNotification.java

示例3: getTableCellEditorComponent

点赞 3

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
public Component getTableCellEditorComponent(JTable table, Object value,
                                             boolean isSelected, final int row, int column) {
    this.row  = row;
    if (isSelected) {
        button.setForeground(table.getSelectionForeground());
        button.setBackground(table.getSelectionBackground());
    } else {
        button.setForeground(table.getForeground());
        button.setBackground(table.getBackground());
    }
    label = "Open";
    button.setText(label);
    button.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.FOLDER_OPEN, 24, FindingMovieUI.BTN_ICON_CLR));

    return button;
}
 

开发者ID:jayamal,
项目名称:FindingMovie,
代码行数:17,
代码来源:IgnoredView.java

示例4: displayTray

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
public void displayTray(String title, String tooltip, String message) throws AWTException, java.net.MalformedURLException {
    SystemTray tray = SystemTray.getSystemTray();
    
    Image image = (Image)IconFontSwing.buildIcon(GoogleMaterialDesignIcons.DELETE, 24, ColorMap.ICON);
    
    TrayIcon trayIcon = new TrayIcon(image, title);
    trayIcon.setImageAutoSize(true);
    trayIcon.setToolTip(tooltip);
    tray.add(trayIcon);
    trayIcon.displayMessage(title, message, MessageType.INFO);
}
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:12,
代码来源:WindowsDesktopNotification.java

示例5: currentDateChanged

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
/**
* If the date is changed it updates the display.
* @param newdate
*/
   void currentDateChanged(CalendarDate newdate) {
       Cursor cur = App.getFrame().getCursor();
       App.getFrame().setCursor(waitCursor);
       if (!changedByHistory) {
          History.add(new HistoryItem(newdate, CurrentProject.get()));
       }
       if (!dateChangedByCalendar) {
           calendarIgnoreChange = true;
           calendar.set(newdate);
           calendarIgnoreChange = false;
       }

       /*if ((currentNote != null) && !changedByHistory && !addedToHistory)
                           History.add(new HistoryItem(currentNote));*/
       currentNoteChanged(currentNote,true);
       currentNote = CurrentProject.getNoteList().getNoteForDate(newdate);
        CurrentNote.set(currentNote,true);
       currentDate = CurrentDate.get();

       /*addedToHistory = false;
       if (!changedByHistory) {
           if (currentNote != null) {
               History.add(new HistoryItem(currentNote));
               addedToHistory = true;
           }
       }*/

       currentDateLabel.setText(newdate.getFullDateString());
       if ((currentNote != null) && (currentNote.isMarked())) {
           currentDateLabel.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.STAR, 8, ColorMap.ICON));
           currentDateLabel.setHorizontalTextPosition(SwingConstants.LEFT);
       }
       else {
           currentDateLabel.setIcon(null);
       }        

       updateIndicators(newdate, CurrentProject.getTaskList());
       App.getFrame().setCursor(cur);
   }
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:44,
代码来源:DailyItemsPanel.java

示例6: updateIcons

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
void updateIcons(){
    taskB.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.VIEW_LIST, 24, ColorMap.ICON));
    alarmB.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.ALARM, 24, ColorMap.ICON));
    collIcon = IconFontSwing.buildIcon(GoogleMaterialDesignIcons.FIRST_PAGE, 24, ColorMap.ICON);
    expIcon = IconFontSwing.buildIcon(GoogleMaterialDesignIcons.LAST_PAGE, 24, ColorMap.ICON);
    if (expanded) {
        toggleButton.setIcon(collIcon);
    }
    else {
        toggleButton.setIcon(expIcon);
    }
}
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:13,
代码来源:DailyItemsPanel.java

示例7: getCellRenderer

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
public ListCellRenderer getCellRenderer() {
       return new DefaultListCellRenderer()  {

    public Component getListCellRendererComponent(
      JList list,
      Object value,            // value to display
      int index,               // cell index
      boolean isSelected,      // is the cell selected
      boolean cellHasFocus)    // the list and the cell have the focus
    {
        JLabel label = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
        String s = value.toString();
        label.setText(s);
        //Note currentNote = CurrentProject.getNoteList().getActiveNote();
        Note currentNote = CurrentNote.get();
        if (currentNote != null) {
           if (getNote(index).getId().equals(currentNote.getId()))
               label.setFont(label.getFont().deriveFont(Font.BOLD));
        }
        if (getNote(index).isMarked())
           label.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.STAR, 8, ColorMap.ICON));
        //setIcon();
      /*if (isSelected) {
            setBackground(list.getSelectionBackground());
          setForeground(list.getSelectionForeground());
      }
        else {
          setBackground(list.getBackground());
          setForeground(list.getForeground());
      }
      setEnabled(list.isEnabled());
      setFont(list.getFont());
        setOpaque(true);*/
        label.setToolTipText(s);
        return label;
    }
   };

}
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:40,
代码来源:NotesList.java

示例8: newTypeB_actionPerformed

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
/**
 * Create new resource type and update the list.
 * @param e
 */
void newTypeB_actionPerformed(ActionEvent e) {
    EditTypeDialog dlg = new EditTypeDialog(App.getFrame(), Local.getString("New resource type"));
    Dimension dlgSize = new Dimension(420, 420);
    dlg.setSize(dlgSize);
    Dimension frmSize = App.getFrame().getSize();
    Point loc = App.getFrame().getLocation();
    dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    dlg.extField.setText(ext);
    dlg.descField.setText(ext);
    dlg.appPanel.argumentsField.setText("$1");
    dlg.iconLabel.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.DESCRIPTION, 24, ColorMap.ICON));
    dlg.setVisible(true);
    if (dlg.CANCELLED)
        return;
    String typeId = Util.generateId();
    MimeType mt = MimeTypesList.addMimeType(typeId);
    String[] exts = dlg.extField.getText().trim().split(" ");
    for (int i = 0; i < exts.length; i++)
        mt.addExtension(exts[i]);
    mt.setLabel(dlg.descField.getText());
    AppList appList = MimeTypesList.getAppList();
    if (dlg.appPanel.applicationField.getText().length() > 0) {
        File f = new File(dlg.appPanel.applicationField.getText());
        String appId = Util.generateId();
        appList.addApp(
            appId,
            f.getParent().replace('\\', '/'),
            f.getName().replace('\\', '/'),
            dlg.appPanel.argumentsField.getText());
        mt.setApp(appId);
    }
    if (dlg.iconPath.length() > 0)
        mt.setIconPath(dlg.iconPath);
    CurrentStorage.get().storeMimeTypesList();
    this.initTypesList();
    typesList.setSelectedValue(mt, true);
}
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:42,
代码来源:ResourceTypePanel.java

示例9: setUp

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	IconFontSwing.register(GoogleMaterialDesignIcons.getIconFont());
	projBeforeTest = ProjectManager.getAllProjectsNumber();
	activeProjBeforeTest = ProjectManager.getActiveProjectsNumber();
	tp1 = ProjectManager.createProject("testProj1", new CalendarDate(1,3,2017), new CalendarDate(1,4,2017));
	tp2 = ProjectManager.createProject("testProj2", new CalendarDate(1,3,2017), null);
	tp3 = ProjectManager.createProject("testProj3", new CalendarDate(1,3,2017), new CalendarDate(15,3,2017));
	tp4 = ProjectManager.createProject("testProj4", new CalendarDate(1,4,2017), new CalendarDate(1,5,2017));
	tp5 = ProjectManager.createProject("testProj5", new CalendarDate(1,4,2017), new CalendarDate(1,5,2017), "Green");
	CurrentDate.set(new CalendarDate(17,3,2017));
}
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:13,
代码来源:ProjectManagerTest.java

示例10: setUp

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	try {
		work = new WorkPanel();
		IconFontSwing.register(GoogleMaterialDesignIcons.getIconFont());
	} catch (HeadlessException e) {
		// Travis in incapable of running these tests
		disableOnTravis = true;
	}
}
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:11,
代码来源:WorkPanelButtonsTest.java

示例11: main

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
public static void main(String[] args) {

        WebLookAndFeel.install();
        IconFontSwing.register(FontAwesome.getIconFont());
        Application app = new Application();
        app.login();

    }
 

开发者ID:CLARIN-PL,
项目名称:WordnetLoom,
代码行数:9,
代码来源:Application.java

示例12: getTableCellRendererComponent

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
public Component getTableCellRendererComponent(JTable table, Object value,
                                               boolean isSelected, boolean hasFocus, int row, int column) {
    if (isSelected) {
        setForeground(table.getSelectionForeground());
        setBackground(table.getSelectionBackground());
    } else {
        setForeground(table.getForeground());
        setBackground(UIManager.getColor("Button.background"));
    }
    setText("Open");
    setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.FOLDER_OPEN, 24, FindingMovieUI.BTN_ICON_CLR));
    return this;
}
 

开发者ID:jayamal,
项目名称:FindingMovie,
代码行数:14,
代码来源:IgnoredView.java

示例13: getTableCellRendererComponent

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
/**
   * Based on panel selected show markings and content related to its 
   * duration in the calendar.
   */
  public Component getTableCellRendererComponent(
      JTable table,
      Object value,
      boolean isSelected,
      boolean hasFocus,
      int row,
      int column) {
  	
JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
String currentPanel = ((AppFrame)App.getFrame()).workPanel.dailyItemsPanel.getCurrentPanel();
if (d == null) {
          label.setEnabled(false);
	label.setIcon(null);
          label.setBackground(ColorMap.NULLDAY);
          return label;
      }
      
if (!isSelected) {
	CalendarDate cpsd = CurrentProject.get().getStartDate();
          CalendarDate cped = CurrentProject.get().getEndDate();
          if (!(((d.after(cpsd)) && (d.before(cped))) || (d.equals(cpsd)) || (d.equals(cped)))) {
		label.setBackground(ColorMap.NOPROJECT);
		return label;
	}
      }



label.setHorizontalTextPosition(2);
label.setEnabled(true);



      if (d.equals(CalendarDate.today())) {
          label.setBorder(BorderFactory.createLineBorder(ColorMap.TODAY));
      }
      
// set foreground color
if (d.getCalendar().get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
          label.setForeground(ColorMap.SUNDAYTEXT);
      }
else { 		
	label.setForeground(ColorMap.DAYTEXT);
}

// set background color
if (currentPanel == null)
	label.setBackground(ColorMap.FREEBG);

else if (currentPanel.equals("TASKS") && (t != null) && 
	(d.inPeriod(t.getStartDate(), t.getEndDate()))) 
		label.setBackground(ColorMap.TASKBG);

else if(currentPanel.equals("NOTES") && 
CurrentProject.getNoteList().getNoteForDate(d) != null) 
			label.setBackground(ColorMap.NOTEBG);

else if(currentPanel.equals("EVENTS") && 
(!(EventsManager.getEventsForDate(d).isEmpty()))) 
			label.setBackground(ColorMap.EVENTBG);

else if(!isSelected)
	label.setBackground(ColorMap.FREEBG);
else {
	label.setBackground(ColorMap.DAYSELECT);
}
// always display NREvents
if (EventsManager.isNonRepeatingEventsForDate(d))
	label.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.PRIORITY_HIGH, 24, ColorMap.PRIORITY));
else
	label.setIcon(null);

      return label;
  }
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:79,
代码来源:JNCalendarCellRenderer.java

示例14: updateCurrentButton

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
void updateCurrentButton(JButton cb,GoogleMaterialDesignIcons icon) {
	currentB.setBackground(ColorMap.CURRENTBACKGROUND);
	currentB.setForeground(ColorMap.CURRENTICON);
	currentB.setIcon(IconFontSwing.buildIcon(icon, 48, ColorMap.CURRENTICON));
	currentB.setOpaque(true);
}
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:7,
代码来源:WorkPanel.java

示例15: App

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
public App(boolean fullmode) {
       super();
       IconFontSwing.register(GoogleMaterialDesignIcons.getIconFont());
       if (fullmode)
           fullmode = !Configuration.get("START_MINIMIZED").equals("yes");
       /* DEBUG */
       if (!fullmode)
           Util.debug("Minimized mode");
       if (!Configuration.get("SHOW_SPLASH").equals("no")){
           showSplash();
       }
       Util.debug(VERSION_INFO);
       Util.debug(Configuration.get("LOOK_AND_FEEL").toString());
       try {
           if (Configuration.get("LOOK_AND_FEEL").equals("system"))
               UIManager.setLookAndFeel(
                   UIManager.getSystemLookAndFeelClassName());
           else if (Configuration.get("LOOK_AND_FEEL").equals("default"))
               UIManager.setLookAndFeel(
                   UIManager.getCrossPlatformLookAndFeelClassName());                    
           else if (
               Configuration.get("LOOK_AND_FEEL").toString().length() > 0)
               UIManager.setLookAndFeel(
                   Configuration.get("LOOK_AND_FEEL").toString());

	} catch (Exception e) {
		new ExceptionDialog(e, "Error when initializing a pluggable look-and-feel. Default LF will be used.", "Make sure that specified look-and-feel library classes are on the CLASSPATH.");
	}
	if (Configuration.get("FIRST_DAY_OF_WEEK").equals("")) {
		String fdow;
		if (Calendar.getInstance().getFirstDayOfWeek() == 2)
			fdow = "mon";
		else
			fdow = "sun";
		Configuration.put("FIRST_DAY_OF_WEEK", fdow);
		Configuration.saveConfig();
		Util.debug("first day of week is set to " + fdow);
	}
	Palette.setPalette(CurrentProject.get().getColor());
	showLogin();
	login.dispose();
	EventsScheduler.init();
	frame = AppFrame.getAppFrame();
	if (fullmode) {
		init();
	}
	if (!Configuration.get("SHOW_SPLASH").equals("no"))
		splash.dispose();
}
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:50,
代码来源:App.java

示例16: updateIcons

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
void updateIcons(){
  todayB.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.TODAY, 24, ColorMap.ICON));
  dayForwardB.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.NAVIGATE_NEXT, 24, ColorMap.ICON));
  dayBackB.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.NAVIGATE_BEFORE, 24, ColorMap.ICON));
}
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:6,
代码来源:JNCalendarPanel.java

示例17: HistoryBackAction

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
public HistoryBackAction() {
    super(Local.getString("History back"));
    this.putValue(SMALL_ICON, IconFontSwing.buildIcon(GoogleMaterialDesignIcons.NAVIGATE_BEFORE, 24, ColorMap.ICON));
    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.ALT_MASK));
    setEnabled(false);
}
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:7,
代码来源:History.java

示例18: HistoryForwardAction

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
public HistoryForwardAction() {
    super(Local.getString("History forward"));
    this.putValue(SMALL_ICON, IconFontSwing.buildIcon(GoogleMaterialDesignIcons.NAVIGATE_NEXT, 24, ColorMap.ICON));
    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.ALT_MASK));
    setEnabled(false);
}
 

开发者ID:ser316asu,
项目名称:SER316-Dresden,
代码行数:7,
代码来源:History.java

示例19: createFrame

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
private void createFrame() {

        try {
            SwingUtilities.invokeAndWait(() -> {
                globalShortCuts = new ArrayList<>();

                // inicjacja menu
                menuHolder = new MenuHolder();

                frame = new MFrame(STANDARD_WIDTH, STANDARD_HEIGHT);
                frame.setTitle(Application.PROGRAM_NAME_VERSION);

                frame.addWindowListener(this);
                frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
                frame.setJMenuBar(menuHolder.getMenuBar());
                frame.setGlassPane(busyPanel = new BusyGlassPane());

                // ustawienie statusu
                user = new WebLabel("");
                Icon icon = IconFontSwing.buildIcon(FontAwesome.USER, 12);
                user.setIcon(icon);

                statusBar = new WebLabel("");

                statusPanel = new WebPanel();
                statusPanel.setBorder(BorderFactory.createEtchedBorder());
                statusPanel.setLayout(new RiverLayout());
                statusPanel.add(statusBar, "hfill left");
                statusPanel.add(user, "right");

                // ustawienie glownego panelu
                mainPane = new WebPanel();
                mainPane.setLayout(new BorderLayout());
                mainPane.add(new WebPanel(), BorderLayout.CENTER);
                mainPane.add(statusPanel, BorderLayout.SOUTH);

                frame.setContentPane(mainPane);
            });

        } catch (InterruptedException | InvocationTargetException ex) {
            logger().error("Error while creating frame", ex);
        }
    }
 

开发者ID:CLARIN-PL,
项目名称:WordnetLoom,
代码行数:44,
代码来源:PanelWorkbench.java

示例20: withIcon

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
public MMenuItem withIcon(FontAwesome icon) {
    Icon i = IconFontSwing.buildIcon(icon, 12);
    setIcon(i);
    return this;
}
 

开发者ID:CLARIN-PL,
项目名称:WordnetLoom,
代码行数:6,
代码来源:MMenuItem.java

示例21: withIcon

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
public MButton withIcon(FontAwesome icon) {
    Icon i = IconFontSwing.buildIcon(icon, 12);
    setIcon(i);
    return this;
}
 

开发者ID:CLARIN-PL,
项目名称:WordnetLoom,
代码行数:6,
代码来源:MButton.java

示例22: Save

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
/**
 * This SavePanel creates a user data manager and its necessary buttons.
 * 
 * @param gui the listener to the SavePanel 
 * @param file the name of the file to be opened or created
 */
public Save(GUI gui, String file){
	/* ******** *
	 * PRE-INIT *
	 * ******** */
	IconFontSwing.register(FontAwesome.getIconFont());
	this.setLayout(new BorderLayout());
	
	/* Set & Load start values for Save Overview Labels */
	initializeLabels(gui, file);
	
	/* ******* *
	 * BUTTONS *
	 * ******* */
	
	/* Load < */
	load = new JButton();
	load.setIcon(IconFontSwing.buildIcon(FontAwesome.CHEVRON_LEFT, 18));
	load.addActionListener(new Listeners.Load(gui, fileName));
	
	/* Save > */
	save = new JButton();
	save.setIcon(IconFontSwing.buildIcon(FontAwesome.CHEVRON_RIGHT, 18));
	save.addActionListener(new Listeners.Save(gui, fileName));
	
	/* Save As [] */
	saveAs = new JButton();
	saveAs.setIcon(IconFontSwing.buildIcon(FontAwesome.FLOPPY_O, 18));
	saveAs.addActionListener(new Listeners.SaveAs(gui, fileName));
	
	/* ************ *
	 * CONTENT INIT *
	 * ************ */
	
	Content = new JPanel();
	Content.setLayout(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.BOTH;
	
	/* Overview */
	Overview = new JPanel();
	Overview.setLayout(new GridBagLayout());
	
	setGBC(c, 0, 0, 1, 1);
	Overview.add(hpLabel, c);
	setGBC(c, 0, 1, 1, 1);
	Overview.add(regionLabel, c);
	setGBC(c, 0, 2, 1, 1);
	Overview.add(geoLabel, c);
	setGBC(c, 0, 3, 1, 1);
	Overview.add(permaLabel, c);
	setGBC(c, 0, 0, 1, 1);
	Content.add(Overview, c);
	
	/* Functions */
	Functions = new JPanel();
	Functions.setLayout(new GridBagLayout());
	
	setGBC(c, 0, 0, 1, 1);
	Functions.add(load,c);
	setGBC(c, 0, 1, 1, 1);
	Functions.add(save,c);
	setGBC(c, 0, 2, 1, 1);
	Functions.add(saveAs,c);
	setGBC(c, 1, 0, 0, 1);
	Content.add(Functions, c);
	
	/* Build */
	this.add(this.Title, BorderLayout.PAGE_START);
	this.add(Content, BorderLayout.CENTER);
	this.add(new JSeparator(), BorderLayout.PAGE_END);
}
 

开发者ID:KayDeeTee,
项目名称:Hollow-Knight-SaveManager,
代码行数:78,
代码来源:Save.java

示例23: ProgressArea

点赞 2

import jiconfont.swing.IconFontSwing; //导入依赖的package包/类
public ProgressArea(){
    GridBagLayout gb = new GridBagLayout();
    JPanel progressContainer = new JPanel(gb);
    progressBarModel = new DefaultBoundedRangeModel();
    progressBar = new JProgressBar(progressBarModel);
    statusMsg = new JLabel();
    statusMsg.setOpaque(true);
    Border border = statusMsg.getBorder();
    Border margin = new EmptyBorder(4,6,4,10);
    statusMsg.setBorder(new CompoundBorder(border, margin));
    statusMsg.setBackground(PROGRESS_BG_CLR);
    GridBagConstraints c = new GridBagConstraints();
    c.weighty = 1;
    c.weightx = 0;
    c.insets = new Insets(3,3,3,3);
    GridBagConstraints c1 = new GridBagConstraints();
    c1.weighty = 1;
    c1.weightx = 1;
    c1.fill = 1;
    c1.insets = new Insets(3,3,3,3);
    GridBagConstraints c2 = new GridBagConstraints();
    c2.weighty = 1;
    c2.weightx = 0;
    c2.insets = new Insets(3,3,3,10);
    cancelBtn = new JButton();
    cancelBtn.setEnabled(Boolean.FALSE);
    progressLbl = new JLabel("0 %");
    progressContainer.add(progressBar, c1);
    progressContainer.add(progressLbl, c);
    progressContainer.add(cancelBtn, c);
    cancelBtn.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.CANCEL, 16, new Color(244,67,5)));
    setBorder(new EmptyBorder(10,10,10,10));
    statusMsg.setVisible(Boolean.FALSE);
    //add(statusMsg, BorderLayout.PAGE_START);
    GridBagLayout gbMain = new GridBagLayout();
    setLayout(gbMain);
    GridBagConstraints cMain = new GridBagConstraints();
    cMain.gridx = 0;
    cMain.gridy = 0;
    cMain.weighty = 0;
    cMain.weightx = 1;
    cMain.fill = 1;
    cMain.insets = new Insets(3,0,1,3);
    add(statusMsg, cMain);
    cMain.gridy = 1;
    add(progressContainer, cMain);
    setBackground(PROGRESS_BG_CLR);
    progressContainer.setBackground(PROGRESS_BG_CLR);
}
 

开发者ID:jayamal,
项目名称:FindingMovie,
代码行数:50,
代码来源:ProgressArea.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)