fix style
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.imyeyu.fx.ui</groupId>
|
||||
<artifactId>timi-fx-ui</artifactId>
|
||||
<version>0.0.3</version>
|
||||
<version>0.0.4</version>
|
||||
|
||||
<properties>
|
||||
<fx.version>25.0.3</fx.version>
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.imyeyu.fx.ui.components;
|
||||
|
||||
import com.imyeyu.fx.ui.TimiFXUI;
|
||||
import javafx.scene.control.Skin;
|
||||
import javafx.scene.control.Slider;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 带填充轨道的滑动条
|
||||
*
|
||||
* @author 夜雨
|
||||
* @since 2026-07-25
|
||||
*/
|
||||
public class FilledSlider extends Slider implements TimiFXUI {
|
||||
|
||||
/** 组件样式 */
|
||||
static final String STYLE_CLASS = "filled-slider";
|
||||
|
||||
/** 默认构造,范围 [0, 1],默认值 0 */
|
||||
public FilledSlider() {
|
||||
this(0, 1, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 标准构造
|
||||
*
|
||||
* @param min 最小值
|
||||
* @param max 最大值
|
||||
* @param value 当前值
|
||||
*/
|
||||
public FilledSlider(double min, double max, double value) {
|
||||
super(min, max, value);
|
||||
getStyleClass().add(STYLE_CLASS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Skin<?> createDefaultSkin() {
|
||||
return new FilledSliderSkin(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserAgentStylesheet() {
|
||||
return Objects.requireNonNull(FilledSlider.class.getResource(RESOURCE + "style/components/filled-slider.css")).toExternalForm();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.imyeyu.fx.ui.components;
|
||||
|
||||
import com.imyeyu.java.ref.Ref;
|
||||
import javafx.scene.control.ProgressBar;
|
||||
import javafx.scene.control.skin.SliderSkin;
|
||||
import javafx.scene.layout.StackPane;
|
||||
|
||||
/**
|
||||
* 填充轨道滑动条皮肤
|
||||
*
|
||||
* @author 夜雨
|
||||
* @since 2026-07-25
|
||||
*/
|
||||
class FilledSliderSkin extends SliderSkin {
|
||||
|
||||
/**
|
||||
* 构造皮肤
|
||||
*
|
||||
* @param control 控件
|
||||
*/
|
||||
FilledSliderSkin(FilledSlider control) {
|
||||
super(control);
|
||||
try {
|
||||
StackPane track = Ref.getFieldValue(this, "track", StackPane.class);
|
||||
ProgressBar pb = new ProgressBar();
|
||||
pb.progressProperty().bind(control.valueProperty().subtract(control.minProperty()).divide(control.maxProperty().subtract(control.minProperty())));
|
||||
pb.prefWidthProperty().bind(track.widthProperty());
|
||||
pb.setMouseTransparent(true);
|
||||
track.getChildren().addFirst(pb);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.imyeyu.fx.ui.components;
|
||||
|
||||
import com.imyeyu.fx.ui.TimiFXUI;
|
||||
import com.imyeyu.java.TimiJava;
|
||||
import com.imyeyu.fx.utils.Nodes;
|
||||
import com.imyeyu.java.TimiJava;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
@@ -13,9 +13,10 @@ import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Skin;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.layout.Border;
|
||||
import javafx.scene.paint.Paint;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 图标按钮,可选图片、SVG 路径或 {@link com.imyeyu.fx.icon.TimiFXIcon} 的字体图标
|
||||
*
|
||||
@@ -141,41 +142,12 @@ public class IconButton extends Button implements TimiFXUI, TimiFXUI.Colorful {
|
||||
* @return 本实例
|
||||
*/
|
||||
public IconButton withBackground() {
|
||||
return withBackground((Border) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加按钮背景
|
||||
*
|
||||
* @param border 边框
|
||||
* @return 本实例
|
||||
*/
|
||||
public IconButton withBackground(Border border) {
|
||||
getStyleClass().add(CSS.BG_BUTTON);
|
||||
if (border != null) {
|
||||
setBorder(border);
|
||||
}
|
||||
setBorder(Stroke.DEFAULT);
|
||||
opacityProperty().unbind();
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加按钮背景
|
||||
*
|
||||
* @param borderClass 边框类
|
||||
* @return 本实例
|
||||
*/
|
||||
public IconButton withBackground(String borderClass) {
|
||||
return withBackground().appendBorderStyle(borderClass);
|
||||
}
|
||||
|
||||
private IconButton appendBorderStyle(String borderClass) {
|
||||
if (TimiJava.isNotEmpty(borderClass)) {
|
||||
getStyleClass().add(borderClass);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自适应尺寸,不使用内边距填充,图标尺寸决定组件尺寸
|
||||
*
|
||||
@@ -187,7 +159,7 @@ public class IconButton extends Button implements TimiFXUI, TimiFXUI.Colorful {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前是否自适应尺寸,ture 时图标尺寸决定组件尺寸
|
||||
* 获取当前是否自适应尺寸,true 时图标尺寸决定组件尺寸
|
||||
*
|
||||
* @return true 为自适应尺寸
|
||||
*/
|
||||
@@ -196,7 +168,7 @@ public class IconButton extends Button implements TimiFXUI, TimiFXUI.Colorful {
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否自适应尺寸,ture 时图标尺寸决定组件尺寸
|
||||
* 设置是否自适应尺寸,true 时图标尺寸决定组件尺寸
|
||||
*
|
||||
* @param autoSize true 为自适应尺寸
|
||||
*/
|
||||
@@ -226,6 +198,6 @@ public class IconButton extends Button implements TimiFXUI, TimiFXUI.Colorful {
|
||||
|
||||
@Override
|
||||
public String getUserAgentStylesheet() {
|
||||
return IconButton.class.getResource(RESOURCE + "style/components/icon-button.css").toExternalForm();
|
||||
return Objects.requireNonNull(IconButton.class.getResource(RESOURCE + "style/components/icon-button.css")).toExternalForm();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import javafx.scene.layout.Region;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 分页组件,支持省略页,滚动页,如 [<][1]..[5][6][7][8][9]..[20][>]
|
||||
@@ -61,8 +62,6 @@ public class Pagination extends HBox implements TimiFXUI {
|
||||
|
||||
/** 默认构造 */
|
||||
public Pagination() {
|
||||
getStylesheets().add(Pagination.class.getResource(RESOURCE + "style/components/pagination.css").toExternalForm());
|
||||
|
||||
// 基本参数
|
||||
lp = new SimpleLongProperty();
|
||||
ip = new SimpleIntegerProperty();
|
||||
@@ -81,7 +80,8 @@ public class Pagination extends HBox implements TimiFXUI {
|
||||
PageButton tb;
|
||||
|
||||
// 上一页
|
||||
prev = new IconButton(TimiFXIcon.get(TimiIcon.ARROW_1_W)).withBackground(Border.EMPTY);
|
||||
prev = new IconButton(TimiFXIcon.get(TimiIcon.ARROW_1_W)).withBackground();
|
||||
prev.setBorder(Border.EMPTY);
|
||||
prev.setMaxHeight(Double.MAX_VALUE);
|
||||
prev.disableProperty().bind(ip.isEqualTo(0));
|
||||
getChildren().add(prev);
|
||||
@@ -150,7 +150,8 @@ public class Pagination extends HBox implements TimiFXUI {
|
||||
}
|
||||
|
||||
// 下一页
|
||||
next = new IconButton(TimiFXIcon.get(TimiIcon.ARROW_1_E)).withBackground(Border.EMPTY);
|
||||
next = new IconButton(TimiFXIcon.get(TimiIcon.ARROW_1_E)).withBackground();
|
||||
next.setBorder(Border.EMPTY);
|
||||
next.setMaxHeight(Double.MAX_VALUE);
|
||||
next.disableProperty().bind(ip.isEqualTo(cp.subtract(1)).or(cp.isEqualTo(0)));
|
||||
|
||||
@@ -195,6 +196,11 @@ public class Pagination extends HBox implements TimiFXUI {
|
||||
next.setOnAction(e -> ip.set(nextI));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserAgentStylesheet() {
|
||||
return Objects.requireNonNull(Pagination.class.getResource(RESOURCE + "style/components/pagination.css")).toExternalForm();
|
||||
}
|
||||
|
||||
/** 选择上一页 */
|
||||
public void prev() {
|
||||
prev.fire();
|
||||
@@ -336,5 +342,10 @@ public class Pagination extends HBox implements TimiFXUI {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserAgentStylesheet() {
|
||||
return Objects.requireNonNull(Pagination.class.getResource(RESOURCE + "style/components/pagination.css")).toExternalForm();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.imyeyu.fx.ui.components;
|
||||
|
||||
import com.imyeyu.fx.ui.TimiFXUI;
|
||||
import com.imyeyu.java.ref.Ref;
|
||||
import javafx.scene.control.ProgressBar;
|
||||
import javafx.scene.control.Skin;
|
||||
import javafx.scene.control.Slider;
|
||||
import javafx.scene.control.skin.SliderSkin;
|
||||
import javafx.scene.layout.StackPane;
|
||||
|
||||
/**
|
||||
* 带有进度的滑动选中,通常是媒体播放进度或音量进度(未对纵向滑动组件测试)
|
||||
*
|
||||
* @author 夜雨
|
||||
* @since 2021-11-09 21:34
|
||||
*/
|
||||
public class ProgressSlider extends Slider implements TimiFXUI {
|
||||
|
||||
private static final String STYLE_CLASS = "progress-slider";
|
||||
|
||||
/** 默认构造,范围 [0, 1],默认值 0 */
|
||||
public ProgressSlider() {
|
||||
this(0, 1, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 标准构造
|
||||
*
|
||||
* @param min 最小值
|
||||
* @param max 最大值
|
||||
* @param value 当前值
|
||||
*/
|
||||
public ProgressSlider(double min, double max, double value) {
|
||||
super(min, max, value);
|
||||
getStyleClass().add(STYLE_CLASS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Skin<?> createDefaultSkin() {
|
||||
Skin<?> skin = super.createDefaultSkin();
|
||||
if (skin instanceof SliderSkin) {
|
||||
try {
|
||||
StackPane track = Ref.getFieldValue(skin, "track", StackPane.class);
|
||||
ProgressBar pb = new ProgressBar();
|
||||
pb.progressProperty().bind(valueProperty().subtract(minProperty()).divide(maxProperty().subtract(minProperty())));
|
||||
pb.prefWidthProperty().bind(track.widthProperty());
|
||||
pb.setMouseTransparent(true);
|
||||
track.getChildren().addFirst(pb);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return skin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserAgentStylesheet() {
|
||||
return ProgressSlider.class.getResource(RESOURCE + "style/components/progress-slider.css").toExternalForm();
|
||||
}
|
||||
}
|
||||
@@ -39,8 +39,8 @@ import javafx.scene.input.ContextMenuEvent;
|
||||
import javafx.scene.input.KeyCode;
|
||||
import javafx.scene.input.KeyEvent;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.Border;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.Border;
|
||||
import javafx.scene.layout.BorderPane;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.layout.HBox;
|
||||
@@ -118,26 +118,31 @@ public class TextAreaEditor extends TextArea implements TimiFXUI {
|
||||
showLineNumber = new SimpleBooleanProperty(true);
|
||||
|
||||
// 撤销
|
||||
undo = new IconButton(TimiFXIcon.get(TimiIcon.ARROW_0_W)).withBackground(Stroke.RIGHT);
|
||||
undo = new IconButton(TimiFXIcon.get(TimiIcon.ARROW_0_W)).withBackground();
|
||||
undo.setBorder(Stroke.RIGHT);
|
||||
undo.disableProperty().bind(undoableProperty().not());
|
||||
PopupTipsService.installText(undo, TimiFXUI.MULTILINGUAL.text("undo"));
|
||||
|
||||
// 重做
|
||||
redo = new IconButton(TimiFXIcon.get(TimiIcon.ARROW_0_E)).withBackground(Stroke.RIGHT);
|
||||
redo = new IconButton(TimiFXIcon.get(TimiIcon.ARROW_0_E)).withBackground();
|
||||
redo.setBorder(Stroke.RIGHT);
|
||||
redo.disableProperty().bind(redoableProperty().not());
|
||||
PopupTipsService.installText(redo, TimiFXUI.MULTILINGUAL.text("redo"));
|
||||
|
||||
// 复制
|
||||
copy = new IconButton(TimiFXIcon.get(TimiIcon.COPY)).withBackground(Stroke.RIGHT);
|
||||
copy = new IconButton(TimiFXIcon.get(TimiIcon.COPY)).withBackground();
|
||||
copy.setBorder(Stroke.RIGHT);
|
||||
PopupTipsService.installText(copy, TimiFXUI.MULTILINGUAL.text("copy"));
|
||||
|
||||
// 剪切
|
||||
cut = new IconButton(TimiFXIcon.get(TimiIcon.CUT)).withBackground(Stroke.RIGHT);
|
||||
cut = new IconButton(TimiFXIcon.get(TimiIcon.CUT)).withBackground();
|
||||
cut.setBorder(Stroke.RIGHT);
|
||||
cut.disableProperty().bind(editableProperty().not());
|
||||
PopupTipsService.installText(cut, TimiFXUI.MULTILINGUAL.text("cut"));
|
||||
|
||||
// 粘贴
|
||||
paste = new IconButton(TimiFXIcon.get(TimiIcon.PASTE)).withBackground(Stroke.RIGHT);
|
||||
paste = new IconButton(TimiFXIcon.get(TimiIcon.PASTE)).withBackground();
|
||||
paste.setBorder(Stroke.RIGHT);
|
||||
paste.disableProperty().bind(editableProperty().not());
|
||||
PopupTipsService.installText(paste, TimiFXUI.MULTILINGUAL.text("paste"));
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.imyeyu.fx.ui.components;
|
||||
|
||||
import com.imyeyu.fx.TimiFX;
|
||||
import com.imyeyu.fx.icon.TimiFXIcon;
|
||||
import com.imyeyu.fx.icon.TimiIcon;
|
||||
import com.imyeyu.fx.ui.TimiFXUI;
|
||||
@@ -73,7 +72,8 @@ public class TextAreaEditorField extends TextField implements TimiFXUI {
|
||||
textGroup.setTranslateY(-.5);
|
||||
|
||||
// 插入编辑器图标
|
||||
IconButton editor = new IconButton(TimiFXIcon.get(TimiIcon.WRITING)).withBackground(Stroke.LEFT);
|
||||
IconButton editor = new IconButton(TimiFXIcon.get(TimiIcon.WRITING)).withBackground();
|
||||
editor.setBorder(Stroke.LEFT);
|
||||
editor.setCursor(Cursor.DEFAULT);
|
||||
|
||||
BorderPane root = new BorderPane();
|
||||
|
||||
@@ -53,7 +53,8 @@ public class TimePicker extends HBox implements TimiFXUI {
|
||||
textField.setAlignment(Pos.CENTER);
|
||||
textField.setPrefWidth(70);
|
||||
textField.setOnContextMenuRequested(Event::consume);
|
||||
IconButton button = new IconButton(TimiFXIcon.get(TimiIcon.CLOCK)).withBackground(Stroke.EX_LEFT);
|
||||
IconButton button = new IconButton(TimiFXIcon.get(TimiIcon.CLOCK)).withBackground();
|
||||
button.setBorder(Stroke.EX_LEFT);
|
||||
|
||||
// 时间选择
|
||||
hour = new ListView<>();
|
||||
|
||||
@@ -68,19 +68,19 @@ public abstract class AbstractAlertFile extends AbstractAlert implements TimiFXU
|
||||
VBox header = new VBox();
|
||||
|
||||
// 主页
|
||||
IconButton home = new IconButton(TimiFXIcon.get(TimiIcon.HOME)).withBackground(Stroke.RIGHT);
|
||||
IconButton home = new IconButton(TimiFXIcon.get(TimiIcon.HOME));
|
||||
PopupTipsService.installText(home, TimiFXUI.MULTILINGUAL.text("home"));
|
||||
|
||||
// 刷新
|
||||
IconButton refresh = new IconButton(TimiFXIcon.get(TimiIcon.REFRESH)).withBackground(Stroke.RIGHT);
|
||||
IconButton refresh = new IconButton(TimiFXIcon.get(TimiIcon.REFRESH));
|
||||
PopupTipsService.installText(refresh, TimiFXUI.MULTILINGUAL.text("refresh"));
|
||||
|
||||
// 创建文件夹
|
||||
IconButton mkdir = new IconButton(TimiFXIcon.get(TimiIcon.FOLDER_ADD)).withBackground(Stroke.RIGHT);
|
||||
IconButton mkdir = new IconButton(TimiFXIcon.get(TimiIcon.FOLDER_ADD));
|
||||
PopupTipsService.installText(mkdir, TimiFXUI.MULTILINGUAL.text("file.mkdir"));
|
||||
|
||||
// 删除
|
||||
IconButton destroy = new IconButton(TimiFXIcon.get(TimiIcon.FAIL, Colorful.RED)).withBackground(Stroke.RIGHT);
|
||||
IconButton destroy = new IconButton(TimiFXIcon.get(TimiIcon.FAIL, Colorful.RED));
|
||||
PopupTipsService.installText(destroy, TimiFXUI.MULTILINGUAL.text("delete"));
|
||||
|
||||
// 切换隐藏
|
||||
@@ -98,7 +98,7 @@ public abstract class AbstractAlertFile extends AbstractAlert implements TimiFXU
|
||||
// 绝对路径
|
||||
absolutePath = new TextField();
|
||||
absolutePath.setBorder(Border.EMPTY);
|
||||
IconButton absolutePathGo = new IconButton(TimiFXIcon.get(TimiIcon.ARROW_2_E)).withBackground(Stroke.LEFT);
|
||||
IconButton absolutePathGo = new IconButton(TimiFXIcon.get(TimiIcon.ARROW_2_E));
|
||||
{
|
||||
if (mode == SelectionMode.SINGLE) {
|
||||
PopupTipsLabel tips = PopupTipsService.installBindingText(absolutePath, absolutePath.textProperty());
|
||||
|
||||
@@ -73,9 +73,6 @@
|
||||
.text-field:focused {
|
||||
-fx-background-insets: 1, 2;
|
||||
}
|
||||
.button:focused {
|
||||
-fx-background-insets: 0;
|
||||
}
|
||||
.list-view:focused {
|
||||
-fx-background-insets: 0, 0, 2;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
.filled-slider .track {
|
||||
-fx-padding: 0;
|
||||
}
|
||||
.filled-slider .progress-bar .bar {
|
||||
-fx-pref-height: 6;
|
||||
-fx-background-insets: 0;
|
||||
}
|
||||
.filled-slider .thumb,
|
||||
.filled-slider:focused .thumb {
|
||||
-fx-background-radius: 0;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
.icon-button {
|
||||
-fx-border-width: 1;
|
||||
-fx-border-color: transparent;
|
||||
-fx-background-insets: 0;
|
||||
-fx-background-radius: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
.x-pagination .button,
|
||||
.x-pagination .toggle-button {
|
||||
.button,
|
||||
.toggle-button {
|
||||
-fx-padding: 0;
|
||||
-fx-pref-width: 28;
|
||||
-fx-pref-height: 26;
|
||||
-fx-background-insets: 0 !important;
|
||||
-fx-background-radius: 0 !important;
|
||||
}
|
||||
.toggle-button:selected {
|
||||
-fx-background-color: -timi-fx-selected-color !important;
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
.progress-slider .track {
|
||||
-fx-padding: 0;
|
||||
}
|
||||
.progress-slider .progress-bar .bar {
|
||||
-fx-pref-height: 6;
|
||||
-fx-background-insets: 0;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
.slider:focused > .thumb {
|
||||
-fx-background-color: -fx-shadow-highlight-color, -fx-outer-border, -fx-inner-border, -fx-body-color;
|
||||
-fx-background-insets: 0 0 -1 0, 0, 1, 2;
|
||||
-fx-background-radius: 0;
|
||||
}
|
||||
.tree-view {
|
||||
-fx-padding: 0;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
-fx-opacity: -timi-fx-opacity-disabled;
|
||||
}
|
||||
.bg-button {
|
||||
-fx-border-color: -timi-fx-border-color;
|
||||
-fx-background-color: -fx-body-color;
|
||||
}
|
||||
.bg-button:hover {
|
||||
|
||||
@@ -5,10 +5,6 @@ import com.imyeyu.fx.ui.examples.component.sidebar.Sidebar;
|
||||
import com.imyeyu.fx.ui.examples.service.PageService;
|
||||
import com.imyeyu.inject.annotation.Component;
|
||||
import com.imyeyu.inject.annotation.PostConstruct;
|
||||
import javafx.application.Platform;
|
||||
import javafx.scene.control.Menu;
|
||||
import javafx.scene.control.MenuBar;
|
||||
import javafx.scene.control.MenuItem;
|
||||
import javafx.scene.layout.BorderPane;
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,7 +40,7 @@ public class Sidebar extends Navigation {
|
||||
add(new NavigationGroup(TimiFXUI.MULTILINGUAL.text("animation")).add(interpolator, smoothScroll));
|
||||
|
||||
// 组件
|
||||
SidebarItem[] components = {SidebarItem.BUTTON, SidebarItem.DATE_TIME_PICKER, SidebarItem.EDITABLE_TABLE_CELL, SidebarItem.FILE_TREE_VIEW, SidebarItem.ICON_BUTTON, SidebarItem.ICON_PICKER, SidebarItem.LABEL_PROGRESS_BAR, SidebarItem.NAVIGATION, SidebarItem.NUMBER_FIELD, SidebarItem.PROGRESS_SLIDER, SidebarItem.SELECTABLE_LABEL, SidebarItem.TEXT_AREA_EDITOR, SidebarItem.TITLE_LABEL, SidebarItem.TOGGLE_ICON, SidebarItem.X_PAGINATION, SidebarItem.X_TAB_PANE, SidebarItem.X_TREE_VIEW};
|
||||
SidebarItem[] components = {SidebarItem.BUTTON, SidebarItem.DATE_TIME_PICKER, SidebarItem.EDITABLE_TABLE_CELL, SidebarItem.FILE_TREE_VIEW, SidebarItem.ICON_BUTTON, SidebarItem.ICON_PICKER, SidebarItem.LABEL_PROGRESS_BAR, SidebarItem.NAVIGATION, SidebarItem.NUMBER_FIELD, SidebarItem.FILLED_SLIDER, SidebarItem.SELECTABLE_LABEL, SidebarItem.TEXT_AREA_EDITOR, SidebarItem.TITLE_LABEL, SidebarItem.TOGGLE_ICON, SidebarItem.X_PAGINATION, SidebarItem.X_TAB_PANE, SidebarItem.X_TREE_VIEW};
|
||||
Item[] componentItems = new Item[components.length];
|
||||
for (int i = 0; i < componentItems.length; i++) {
|
||||
componentItems[i] = new Item(components[i]);
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.imyeyu.fx.ui.examples.view.pages.component.IconPickerDemo;
|
||||
import com.imyeyu.fx.ui.examples.view.pages.component.LabelProgressBarDemo;
|
||||
import com.imyeyu.fx.ui.examples.view.pages.component.NavigationDemo;
|
||||
import com.imyeyu.fx.ui.examples.view.pages.component.NumberFieldDemo;
|
||||
import com.imyeyu.fx.ui.examples.view.pages.component.ProgressSliderDemo;
|
||||
import com.imyeyu.fx.ui.examples.view.pages.component.FilledSliderDemo;
|
||||
import com.imyeyu.fx.ui.examples.view.pages.component.SelectableLabelDemo;
|
||||
import com.imyeyu.fx.ui.examples.view.pages.component.TextAreaEditorDemo;
|
||||
import com.imyeyu.fx.ui.examples.view.pages.component.TitleLabelDemo;
|
||||
@@ -106,7 +106,7 @@ public enum SidebarItem {
|
||||
NUMBER_FIELD(NumberFieldDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.number_field")),
|
||||
|
||||
/** 进度调整 */
|
||||
PROGRESS_SLIDER(ProgressSliderDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.progress_slider")),
|
||||
FILLED_SLIDER(FilledSliderDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.progress_slider")),
|
||||
|
||||
/** 可选标签 */
|
||||
SELECTABLE_LABEL(SelectableLabelDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.selectable_label")),
|
||||
|
||||
@@ -26,14 +26,8 @@ public abstract class ViewMain extends Application implements TimiFXUI {
|
||||
|
||||
@Override
|
||||
public void start(final Stage stage) {
|
||||
PerspectiveCamera perspectiveCamera = new PerspectiveCamera(false);
|
||||
perspectiveCamera.setTranslateX(0);
|
||||
perspectiveCamera.setTranslateY(0);
|
||||
perspectiveCamera.setTranslateZ(0);
|
||||
|
||||
Scene scene = new Scene(root);
|
||||
TimiFXUI.applyStyle(scene);
|
||||
scene.setCamera(perspectiveCamera);
|
||||
stage.setTitle(TimiFXUI.MULTILINGUAL.text("fx.example.title"));
|
||||
stage.getIcons().add(new Image(RESOURCE + "icon.png"));
|
||||
stage.setScene(scene);
|
||||
|
||||
+8
-8
@@ -1,7 +1,7 @@
|
||||
package com.imyeyu.fx.ui.examples.view.pages.component;
|
||||
|
||||
import com.imyeyu.fx.ui.TimiFXUI;
|
||||
import com.imyeyu.fx.ui.components.ProgressSlider;
|
||||
import com.imyeyu.fx.ui.components.FilledSlider;
|
||||
import com.imyeyu.fx.ui.examples.component.AbstractDemoPane;
|
||||
import com.imyeyu.fx.ui.examples.component.sidebar.SidebarItem;
|
||||
import com.imyeyu.inject.annotation.Component;
|
||||
@@ -10,21 +10,21 @@ import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.FlowPane;
|
||||
|
||||
/**
|
||||
* 拖拽进度组件
|
||||
* 填充轨道滑动条示例
|
||||
*
|
||||
* @author 夜雨
|
||||
* @since 2022-08-30 09:36
|
||||
*/
|
||||
@Component
|
||||
public class ProgressSliderDemo extends AbstractDemoPane {
|
||||
public class FilledSliderDemo extends AbstractDemoPane {
|
||||
|
||||
public ProgressSliderDemo() {
|
||||
title.setText(SidebarItem.PROGRESS_SLIDER.getText());
|
||||
document.sync("https://doc.imyeyu.net/timi-fx/net/imyeyu/timifx/component/ProgressSlider.html");
|
||||
source.sync("https://git.imyeyu.net/Timi/timi-fx/src/master/src/main/java/net/imyeyu/timifx/component/ProgressSlider.java");
|
||||
public FilledSliderDemo() {
|
||||
title.setText(SidebarItem.FILLED_SLIDER.getText());
|
||||
document.sync("https://doc.imyeyu.net/timi-fx/net/imyeyu/timifx/component/FilledSlider.html");
|
||||
source.sync("https://git.imyeyu.net/Timi/timi-fx/src/master/src/main/java/net/imyeyu/timifx/component/FilledSlider.java");
|
||||
|
||||
// 组件
|
||||
ProgressSlider slider = new ProgressSlider();
|
||||
FilledSlider slider = new FilledSlider();
|
||||
slider.setPrefWidth(360);
|
||||
slider.setValue(.5);
|
||||
|
||||
@@ -8,6 +8,8 @@ import com.imyeyu.fx.ui.examples.component.AbstractDemoPane;
|
||||
import com.imyeyu.fx.ui.examples.component.sidebar.SidebarItem;
|
||||
import com.imyeyu.inject.annotation.Component;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.layout.Border;
|
||||
import javafx.scene.layout.GridPane;
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,7 +37,9 @@ public class ToggleIconDemo extends AbstractDemoPane {
|
||||
// 按钮背景
|
||||
Label labelWithBG = TimiFXUI.label(TimiFXUI.MULTILINGUAL.text("fx.example.toggle_icon.with_bg"));
|
||||
ToggleIcon withBG = new ToggleIcon(TimiFXIcon.get(TimiIcon.ARROW_0_W)).withBackground();
|
||||
withBG.setBorder(Stroke.DEFAULT);
|
||||
ToggleIcon withBGDiff = new ToggleIcon(TimiFXIcon.get(TimiIcon.ARROW_0_W), TimiFXIcon.get(TimiIcon.ARROW_0_E)).withBackground();
|
||||
withBGDiff.setBorder(Stroke.DEFAULT);
|
||||
|
||||
setCenter(new GridPane() {{
|
||||
setHgap(5);
|
||||
|
||||
Reference in New Issue
Block a user