Skip to content

Commit

Permalink
feat(frame): 接口权限控制 (#750)
Browse files Browse the repository at this point in the history
Co-authored-by: unknowIfGuestInDream <liang.tang.cx@gmail.com>
  • Loading branch information
unknowIfGuestInDream committed Sep 19, 2023
1 parent 9133dba commit fcff569
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* @author unknowIfGuestInDream
*/
public interface FxBindingBuilder<T> {
public sealed interface FxBindingBuilder<T> permits FxBooleanBindingBuilder {

Binding<T> build();
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* @author unknowIfGuestInDream
*/
public abstract class FxBooleanBindingBuilder implements FxBindingBuilder<Boolean> {
public abstract non-sealed class FxBooleanBindingBuilder implements FxBindingBuilder<Boolean> {

@SuppressWarnings("exports")
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
* Add a drop shadow to the top of the scroll pane.
*
* @author unknowIfGuestInDream
* @date 2023/8/27 17:35
*/
public class ShadowScrollPane extends ScrollPane {

Expand All @@ -63,9 +62,8 @@ private void init() {
setHbarPolicy(ScrollBarPolicy.NEVER);

shadow.setManaged(false);
shadow.setStyle("-fx-pref-height: 10;" +
"-fx-background-color: black;" +
"-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, .75), 20, 0.19, 0, 6);");
shadow.setStyle("-fx-pref-height: 10;" + "-fx-background-color: black;"
+ "-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, .75), 20, 0.19, 0, 6);");
shadow.getStyleClass().add("shadow");
shadow.visibleProperty().bind(showShadowProperty());
shadow.setMouseTransparent(true);
Expand Down Expand Up @@ -108,7 +106,8 @@ protected void layoutChildren() {
Insets insets = getInsets();
double w = getWidth();
double offset = computeOffset();
shadow.resizeRelocate(-10, insets.getTop() - shadow.prefHeight(-1) - SHADOW_HEIGHT + offset, w + 20, shadow.prefHeight(-1) - 1);
shadow.resizeRelocate(-10, insets.getTop() - shadow.prefHeight(-1) - SHADOW_HEIGHT + offset, w + 20,
shadow.prefHeight(-1) - 1);
lastOffset = offset;
}
}
Expand Down
3 changes: 2 additions & 1 deletion frame/src/main/java/com/tlcsdm/frame/Sample.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@

package com.tlcsdm.frame;

import com.tlcsdm.frame.model.EmptySample;
import javafx.scene.Node;
import javafx.scene.image.ImageView;
import javafx.stage.Stage;

/**
* @author unknowIfGuestInDream
*/
public interface Sample {
public sealed interface Sample permits EmptySample, SampleBase {

/**
* 组件id
Expand Down
2 changes: 1 addition & 1 deletion frame/src/main/java/com/tlcsdm/frame/SampleBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
*
* @author unknowIfGuestInDream
*/
public abstract class SampleBase extends Application implements Sample {
public abstract non-sealed class SampleBase extends Application implements Sample {

protected Map<String, Object> userData = new LinkedHashMap<>();
protected String aesSeed = "3f4eefd3525675154a5e3a0183d8087b";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/**
* @author unknowIfGuestInDream
*/
public class EmptySample implements Sample {
public final class EmptySample implements Sample {
private final String name;

public EmptySample(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @author unknowIfGuestInDream
* @date 2023/5/4 14:53
*/
public abstract class AbstractU2XFamilyScript extends AbstractEcmScript {
public abstract sealed class AbstractU2XFamilyScript extends AbstractEcmScript permits U2AEcmScript, U2CEcmScript {

@Override
protected Map<String, Object> dealErrorSourceData(ExcelReader reader, int rowNum, String product) {
Expand Down Expand Up @@ -124,7 +124,9 @@ protected void handlerErrorSourceMap(Map<String, Object> errorSource, String pro
/**
* function数据后置处理
*/
protected void handlerOperationSupport(Map<String, Object> operation, String funcSupCondition, boolean optMaskintStatus) {
GroovyUtil.invokeMethod(getGroovyPath(), "handlerOperationSupport", operation, funcSupCondition, optMaskintStatus);
protected void handlerOperationSupport(Map<String, Object> operation, String funcSupCondition,
boolean optMaskintStatus) {
GroovyUtil.invokeMethod(getGroovyPath(), "handlerOperationSupport", operation, funcSupCondition,
optMaskintStatus);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
import java.util.Map;

/**
* C1M的ECM脚本
* C1M的ECM脚本.
*
* @author unknowIfGuestInDream
* @date 2023/3/26 21:17
*/
public class C1MEcmScript extends AbstractEcmScript {
public final class C1MEcmScript extends AbstractEcmScript {

@Override
protected void initDefaultValue() {
Expand Down Expand Up @@ -196,7 +196,7 @@ private void handlerErrorSourceMap(Map<String, Object> errorSource) {
* 处理使能条件的 * 信息, 默认是support = true下的
*/
private void handlerOperationSupport(Map<String, Object> operation, String funcSupCondition,
boolean optMaskintStatus) {
boolean optMaskintStatus) {
// Do nothing
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @author unknowIfGuestInDream
* @date 2023/3/26 21:17
*/
public class U2AEcmScript extends AbstractU2XFamilyScript {
public final class U2AEcmScript extends AbstractU2XFamilyScript {

@Override
protected void initDefaultValue() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @author unknowIfGuestInDream
* @date 2023/3/26 21:17
*/
public class U2CEcmScript extends AbstractU2XFamilyScript {
public final class U2CEcmScript extends AbstractU2XFamilyScript {

@Override
protected void initDefaultValue() {
Expand Down

0 comments on commit fcff569

Please sign in to comment.