use of com.willwinder.universalgcodesender.uielements.components.RoundedPanel in project Universal-G-Code-Sender by winder.
the class WizardPanelImportSettings method initComponents.
private void initComponents() {
labelDescription = new JLabel("<html><body><p>" + Localization.getString("platform.plugin.setupwizard.import-settings.intro") + "</p></body></html>");
fileInfoPanel = new RoundedPanel(8);
fileInfoPanel.setBackground(ThemeColors.VERY_LIGHT_BLUE_GREY);
fileInfoPanel.setForeground(ThemeColors.LIGHT_GREY);
labelNameValue = new JLabel("");
labelNameValue.setFont(labelNameValue.getFont().deriveFont(Font.BOLD, 16));
labelFirmware = new JLabel(Localization.getString("platform.plugin.setupwizard.import-settings.firmware"), JLabel.RIGHT);
labelFirmware.setFont(labelFirmware.getFont().deriveFont(Font.BOLD));
labelFirmwareValue = new JLabel("");
labelCreatedBy = new JLabel(Localization.getString("platform.plugin.setupwizard.import-settings.created-by"), JLabel.RIGHT);
labelCreatedBy.setFont(labelCreatedBy.getFont().deriveFont(Font.BOLD));
labelCreatedByValue = new JLabel("");
labelDate = new JLabel(Localization.getString("platform.plugin.setupwizard.import-settings.created-date"), JLabel.RIGHT);
labelDate.setFont(labelDate.getFont().deriveFont(Font.BOLD));
labelDateValue = new JLabel("");
labelSettingsImported = new JLabel("<html><body>" + "<h3>" + Localization.getString("platform.plugin.setupwizard.import-settings.finished-title") + "</h3>" + "<p>" + Localization.getString("platform.plugin.setupwizard.import-settings.finished-description") + "</p>" + "</body></html>");
labelSettingsImported.setVerticalAlignment(SwingConstants.CENTER);
labelSettingsImported.setIcon(ImageUtilities.loadImageIcon("icons/checked32.png", false));
buttonOpen = new JButton(Localization.getString("platform.plugin.setupwizard.import-settings.open-settings"));
buttonOpen.addActionListener(event -> {
JFileChooser fileChooser = FirmwareSettingsFileTypeFilter.getSettingsFileChooser();
int returnVal = fileChooser.showOpenDialog(new JFrame());
if (returnVal == JFileChooser.APPROVE_OPTION) {
loadSettingsFile(fileChooser.getSelectedFile());
}
});
buttonImport = new JButton(Localization.getString("platform.plugin.setupwizard.import-settings.import"));
buttonImport.addActionListener(event -> importSettings());
}
use of com.willwinder.universalgcodesender.uielements.components.RoundedPanel in project Universal-G-Code-Sender by winder.
the class WizardPanelMotorWiring method initComponents.
private void initComponents() {
labelDescription = new JLabel("<html><body><p>" + Localization.getString("platform.plugin.setupwizard.motor-wiring.intro") + "</p></body></html>");
softLimitsInfo = new RoundedPanel(8);
softLimitsInfo.setLayout(new MigLayout("fill, inset 10, gap 0"));
softLimitsInfo.setBackground(ThemeColors.VERY_LIGHT_BLUE_GREY);
softLimitsInfo.setForeground(ThemeColors.LIGHT_GREY);
softLimitsInfo.add(new JLabel(ImageUtilities.loadImageIcon("icons/information24.png", false)), "gapright 10");
softLimitsInfo.add(new JLabel("<html><body>" + Localization.getString("platform.plugin.setupwizard.motor-wiring.soft-limits-enabled") + "</body></html>"));
navigationButtons = new NavigationButtons(getBackend(), 0.1, 100);
checkboxReverseX = new JCheckBox(Localization.getString("platform.plugin.setupwizard.motor-wiring.reverse-direction"));
checkboxReverseX.addActionListener(event -> {
if (getBackend().getController() != null) {
try {
getBackend().getController().getFirmwareSettings().setInvertDirection(Axis.X, checkboxReverseX.isSelected());
} catch (FirmwareSettingsException e) {
e.printStackTrace();
}
}
});
checkboxReverseY = new JCheckBox(Localization.getString("platform.plugin.setupwizard.motor-wiring.reverse-direction"));
checkboxReverseY.addActionListener(event -> {
if (getBackend().getController() != null) {
try {
getBackend().getController().getFirmwareSettings().setInvertDirection(Axis.Y, checkboxReverseY.isSelected());
} catch (FirmwareSettingsException e) {
e.printStackTrace();
}
}
});
checkboxReverseZ = new JCheckBox(Localization.getString("platform.plugin.setupwizard.motor-wiring.reverse-direction"));
checkboxReverseZ.addActionListener(event -> {
if (getBackend().getController() != null) {
try {
getBackend().getController().getFirmwareSettings().setInvertDirection(Axis.Z, checkboxReverseZ.isSelected());
} catch (FirmwareSettingsException e) {
e.printStackTrace();
}
}
});
}
use of com.willwinder.universalgcodesender.uielements.components.RoundedPanel in project Universal-G-Code-Sender by winder.
the class MachineStatusPanel method addAxisPanel.
private void addAxisPanel(char axis, JLabel work, JLabel machine) {
RoundedPanel axisPanel = new RoundedPanel(COMMON_RADIUS);
axisPanel.setBackground(ThemeColors.VERY_DARK_GREY);
axisPanel.setForeground(ThemeColors.LIGHT_BLUE);
axisPanel.setLayout(new MigLayout("fillx, wrap 2, inset 7, gap 0", "[left][grow, right]"));
RoundedPanel resetPanel = new RoundedPanel(COMMON_RADIUS);
resetPanel.setForeground(ThemeColors.LIGHT_BLUE);
resetPanel.setBackground(ThemeColors.DARK_BLUE_GREY);
resetPanel.setBackgroundDisabled(ThemeColors.VERY_DARK_GREY);
resetPanel.setHoverBackground(ThemeColors.MED_BLUE_GREY);
resetPanel.setLayout(new MigLayout("inset 5 15 5 15"));
JLabel axisLabel = new JLabel(String.valueOf(axis));
axisLabel.setForeground(ThemeColors.LIGHT_BLUE);
resetPanel.add(axisLabel, "al center, dock center, id axis");
JLabel zeroLabel = new JLabel("0");
zeroLabel.setForeground(ThemeColors.LIGHT_BLUE);
resetPanel.add(zeroLabel, "pos (axis.x + axis.w - 4) (axis.y + axis.h - 25)");
work.setForeground(ThemeColors.LIGHT_BLUE);
machine.setForeground(ThemeColors.LIGHT_BLUE);
axisPanel.add(resetPanel, "sy 2");
axisPanel.add(work);
axisPanel.add(machine, "span 2");
machineStatusFontManager.addAxisResetLabel(axisLabel);
machineStatusFontManager.addAxisResetZeroLabel(zeroLabel);
machineStatusFontManager.addWorkCoordinateLabel(work);
machineStatusFontManager.addMachineCoordinateLabel(machine);
add(axisPanel, "growx, span 2");
resetPanel.addClickListener(() -> resetCoordinateButton(axis));
axisResetControls.add(axisPanel);
}
use of com.willwinder.universalgcodesender.uielements.components.RoundedPanel in project Universal-G-Code-Sender by winder.
the class PreviewListPanel method setCategory.
public void setCategory(Category category) {
buttonsPanel.removeAll();
sources.stream().flatMap(source -> source.getCliparts(category).stream()).sorted((clipart1, clipart2) -> clipart1.getName().compareTo(clipart2.getName())).forEach(clipart -> {
Component preview = clipart.getPreview();
RoundedPanel roundedPanel = new RoundedPanel(12);
roundedPanel.setLayout(new MigLayout("fill, inset 0"));
roundedPanel.setMinimumSize(new Dimension(128, 128));
roundedPanel.setForeground(ThemeColors.LIGHT_GREY);
roundedPanel.setBackground(Color.WHITE);
roundedPanel.setHoverBackground(ThemeColors.LIGHT_GREY);
roundedPanel.setPressedBackground(ThemeColors.VERY_LIGHT_BLUE_GREY);
roundedPanel.add(preview, "grow");
roundedPanel.addClickListener(() -> {
selectedClipart = clipart;
selectAction.actionPerformed(new ActionEvent(roundedPanel, 0, "selected_clipart"));
});
buttonsPanel.add(roundedPanel);
});
buttonsPanel.revalidate();
buttonsPanel.repaint();
}
Aggregations