no message
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.UI_;
|
||||
public class HyperlinksStyledList extends StyledList {
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.UI_;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@@ -29,7 +29,7 @@ public class MenuBarButton extends JButton {
|
||||
public void setIcon(String icon_path) {
|
||||
setIcon(Utils_.getIcon(icon_path));
|
||||
}
|
||||
public void setFont(VisualiserFonts font_in){
|
||||
public void setFont(VisualiserFonts font_in) {
|
||||
setFont(UI_.getTheme().Fonts.get(font_in));
|
||||
}
|
||||
}
|
||||
|
||||
24
src/Common/Visual/Controls/PassButton.java
Normal file
24
src/Common/Visual/Controls/PassButton.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Passes.Pass;
|
||||
|
||||
import java.awt.*;
|
||||
public class PassButton extends MenuBarButton implements PassControl {
|
||||
public PassButton(Pass pass, boolean tab) {
|
||||
setText(pass.getButtonText());
|
||||
setToolTipText(pass.getDescription());
|
||||
if (pass.getIconPath() != null) {
|
||||
if (tab) {
|
||||
setIcon(pass.getTabIcon());
|
||||
setPreferredSize(new Dimension(18, 18));
|
||||
setMaximumSize(new Dimension(18, 18));
|
||||
setMinimumSize(new Dimension(18, 18));
|
||||
} else
|
||||
setIcon(pass.getIconPath());
|
||||
}
|
||||
addActionListener(pass.getControlAction());
|
||||
pass.controls.add(this);
|
||||
}
|
||||
public PassButton(Pass pass) {
|
||||
this(pass, false);
|
||||
}
|
||||
}
|
||||
8
src/Common/Visual/Controls/PassControl.java
Normal file
8
src/Common/Visual/Controls/PassControl.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package Common.Visual.Controls;
|
||||
public interface PassControl {
|
||||
void setIcon(String icon_path);
|
||||
void setEnabled(boolean flag);
|
||||
void setVisible(boolean flag);
|
||||
void setToolTipText(String text);
|
||||
void setText(String text);
|
||||
}
|
||||
17
src/Common/Visual/Controls/PassMenuItem.java
Normal file
17
src/Common/Visual/Controls/PassMenuItem.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
public class PassMenuItem extends VisualiserMenuItem implements PassControl {
|
||||
public PassMenuItem(Pass pass) {
|
||||
setText(pass.getDescription());
|
||||
setToolTipText(pass.getDescription());
|
||||
if (pass.getIconPath() != null) setIcon(pass.getIconPath());
|
||||
addActionListener(pass.getControlAction());
|
||||
pass.controls.add(this);
|
||||
}
|
||||
@Override
|
||||
public void setIcon(String icon_path) {
|
||||
setIcon(Utils_.getIcon(icon_path));
|
||||
}
|
||||
}
|
||||
15
src/Common/Visual/Controls/ShortLabel.java
Normal file
15
src/Common/Visual/Controls/ShortLabel.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package Common.Visual.Controls;
|
||||
import javax.swing.*;
|
||||
public class ShortLabel extends JLabel {
|
||||
int max = 0;
|
||||
public ShortLabel(int max_in) {
|
||||
max = max_in;
|
||||
}
|
||||
@Override
|
||||
public void setText(String text_in) {
|
||||
if ((max > 0) && (text_in.length() > max)) {
|
||||
super.setText(text_in.substring(0, max - 1) + "...");
|
||||
} else super.setText(text_in);
|
||||
setToolTipText(text_in);
|
||||
}
|
||||
}
|
||||
41
src/Common/Visual/Controls/StableMenuItem.java
Normal file
41
src/Common/Visual/Controls/StableMenuItem.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import Common.Visual.UI_;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.basic.BasicMenuItemUI;
|
||||
//неичезающий меню итем. нужен для настроек
|
||||
//https://translated.turbopages.org/proxy_u/en-ru.ru.64537f6c-6460c460-8e74a1ab-74722d776562/https/tips4java.wordpress.com/2010/09/12/keeping-menus-open/
|
||||
class StableItemUI extends BasicMenuItemUI {
|
||||
public static ComponentUI createUI(JComponent c) {
|
||||
return new StableItemUI();
|
||||
}
|
||||
@Override
|
||||
protected void doClick(MenuSelectionManager msm) {
|
||||
menuItem.doClick(0);
|
||||
if (UI_.last_menu_path != null)
|
||||
MenuSelectionManager.defaultManager().setSelectedPath(UI_.last_menu_path);
|
||||
}
|
||||
}
|
||||
public class StableMenuItem extends VisualiserMenuItem {
|
||||
{
|
||||
getModel().addChangeListener(e -> {
|
||||
if (getModel().isArmed() && isShowing())
|
||||
UI_.last_menu_path = MenuSelectionManager.defaultManager().getSelectedPath();
|
||||
});
|
||||
}
|
||||
public StableMenuItem(String text) {
|
||||
super(text);
|
||||
setUI(new StableItemUI());
|
||||
}
|
||||
public StableMenuItem(String text, String icon_path) {
|
||||
super(text);
|
||||
setIcon(Utils_.getIcon(icon_path));
|
||||
setUI(new StableItemUI());
|
||||
}
|
||||
public StableMenuItem() {
|
||||
setUI(new StableItemUI());
|
||||
}
|
||||
}
|
||||
16
src/Common/Visual/Controls/StablePassMenuItem.java
Normal file
16
src/Common/Visual/Controls/StablePassMenuItem.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Utils.Utils_;
|
||||
public class StablePassMenuItem extends StableMenuItem implements PassControl {
|
||||
public StablePassMenuItem(Pass pass) {
|
||||
setText(pass.getDescription());
|
||||
setToolTipText(pass.getDescription());
|
||||
if (pass.getIconPath() != null) setIcon(pass.getIconPath());
|
||||
addActionListener(pass.getControlAction());
|
||||
pass.controls.add(this);
|
||||
}
|
||||
@Override
|
||||
public void setIcon(String icon_path) {
|
||||
setIcon(Utils_.getIcon(icon_path));
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.UI_;
|
||||
|
||||
import javax.swing.*;
|
||||
public class StyledList extends JList implements ThemeElement {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.UI_;
|
||||
|
||||
import javax.swing.*;
|
||||
public class StyledProgressBar extends JProgressBar implements ThemeElement {
|
||||
|
||||
Reference in New Issue
Block a user