Browse Source

滑块控件(未完成)

master
richie 5 years ago
commit
a5ec6777cb
  1. 5
      .gitignore
  2. BIN
      lib/finekit-10.0.jar
  3. 0
      lib/report/.gitkeep
  4. 35
      src/main/java/com/fr/plugin/parameter/slider/SliderBridge.java
  5. 17
      src/main/java/com/fr/plugin/parameter/slider/SliderJavaScriptBridge.java
  6. 18
      src/main/java/com/fr/plugin/parameter/slider/SliderJavaScriptHolderBridge.java
  7. 15
      src/main/java/com/fr/plugin/parameter/slider/SliderLocaleBridge.java
  8. 17
      src/main/java/com/fr/plugin/parameter/slider/SliderStyleHolderBridge.java
  9. 31
      src/main/java/com/fr/plugin/parameter/slider/design/XSlider.java
  10. 33
      src/main/java/com/fr/plugin/parameter/slider/fun/Slider.java
  11. BIN
      src/main/resources/com/fr/plugin/parameter/slider/images/slider.png
  12. 1
      src/main/resources/com/fr/plugin/parameter/slider/slider.properties
  13. 1
      src/main/resources/com/fr/plugin/parameter/slider/slider_zh_CN.properties
  14. 31
      src/main/resources/com/fr/plugin/parameter/slider/web/slider.js

5
.gitignore vendored

@ -0,0 +1,5 @@
*.iml
.idea/
lib/report/*.jar
.classpath
.DS_Store

BIN
lib/finekit-10.0.jar

Binary file not shown.

0
lib/report/.gitkeep

35
src/main/java/com/fr/plugin/parameter/slider/SliderBridge.java

@ -0,0 +1,35 @@
package com.fr.plugin.parameter.slider;
import com.fanruan.api.i18n.I18nKit;
import com.fr.design.fun.impl.AbstractParameterWidgetOptionProvider;
import com.fr.form.ui.Widget;
import com.fr.plugin.parameter.slider.design.XSlider;
import com.fr.plugin.parameter.slider.fun.Slider;
/**
* @author richie
* @version 10.0
* Created by richie on 2019/9/29
*/
public class SliderBridge extends AbstractParameterWidgetOptionProvider {
@Override
public Class<? extends Widget> classForWidget() {
return Slider.class;
}
@Override
public Class<?> appearanceForWidget() {
return XSlider.class;
}
@Override
public String iconPathForWidget() {
return "/com/fr/plugin/parameter/slider/images/slider.png";
}
@Override
public String nameForWidget() {
return I18nKit.getLocText("Plugin-Slider_Name");
}
}

17
src/main/java/com/fr/plugin/parameter/slider/SliderJavaScriptBridge.java

@ -0,0 +1,17 @@
package com.fr.plugin.parameter.slider;
import com.fr.stable.fun.impl.AbstractJavaScriptFileHandler;
/**
* @author richie
* @version 10.0
* Created by richie on 2019/9/29
*/
public class SliderJavaScriptBridge extends AbstractJavaScriptFileHandler {
@Override
public String[] pathsForFiles() {
return new String[] {
"/com/fr/plugin/parameter/slider/web/slider.js"
};
}
}

18
src/main/java/com/fr/plugin/parameter/slider/SliderJavaScriptHolderBridge.java

@ -0,0 +1,18 @@
package com.fr.plugin.parameter.slider;
import com.fr.stable.fun.impl.AbstractJavaScriptPlaceHolder;
/**
* @author richie
* @version 10.0
* Created by richie on 2019/9/29
*/
public class SliderJavaScriptHolderBridge extends AbstractJavaScriptPlaceHolder {
@Override
public ScriptTag[] holderScripts() {
return new ScriptTag[]{
ScriptTag.build().type("text/javascript").src("http://fanruan.design/fineui/2.0/fineui.min.js")
};
}
}

15
src/main/java/com/fr/plugin/parameter/slider/SliderLocaleBridge.java

@ -0,0 +1,15 @@
package com.fr.plugin.parameter.slider;
import com.fr.stable.fun.impl.AbstractLocaleFinder;
/**
* @author richie
* @version 10.0
* Created by richie on 2019/9/29
*/
public class SliderLocaleBridge extends AbstractLocaleFinder {
@Override
public String find() {
return "com/fr/plugin/parameter/slider/slider";
}
}

17
src/main/java/com/fr/plugin/parameter/slider/SliderStyleHolderBridge.java

@ -0,0 +1,17 @@
package com.fr.plugin.parameter.slider;
import com.fr.stable.fun.impl.AbstractStylePlaceHolder;
/**
* @author richie
* @version 10.0
* Created by richie on 2019/9/29
*/
public class SliderStyleHolderBridge extends AbstractStylePlaceHolder {
@Override
public LinkTag[] holderLinks() {
return new LinkTag[] {
LinkTag.build().type("text/css").rel("stylesheet").href("http://fanruan.design/fineui/2.0/fineui.min.css")
};
}
}

31
src/main/java/com/fr/plugin/parameter/slider/design/XSlider.java

@ -0,0 +1,31 @@
package com.fr.plugin.parameter.slider.design;
import com.fanruan.api.design.work.form.creator.Attribute;
import com.fanruan.api.design.work.form.creator.XOpenCreator;
import com.fr.design.gui.islider.UISlider;
import com.fr.plugin.parameter.slider.fun.Slider;
import javax.swing.*;
import java.awt.*;
/**
* @author richie
* @version 10.0
* Created by richie on 2019/9/29
*/
public class XSlider extends XOpenCreator {
public XSlider(Slider slider, Dimension size) {
super(slider, size);
}
@Override
public Attribute[] attributes() {
return new Attribute[0];
}
@Override
protected JComponent initEditor() {
return new UISlider();
}
}

33
src/main/java/com/fr/plugin/parameter/slider/fun/Slider.java

@ -0,0 +1,33 @@
package com.fr.plugin.parameter.slider.fun;
import com.fanruan.api.report.form.BaseWidget;
import com.fr.intelli.record.Focus;
import com.fr.json.JSONObject;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.stable.script.CalculatorProvider;
import com.fr.stable.web.Repository;
/**
* @author richie
* @version 10.0
* Created by richie on 2019/9/29
*/
@EnableMetrics
public class Slider extends BaseWidget {
@Override
@Focus(id = "com.fr.plugin.parameter.slider", text = "Plugin-Slider_Name")
public void mixinJSON(Repository repository, CalculatorProvider calculatorProvider, JSONObject jsonObject) {
}
@Override
public String getXType() {
return "parameter.slider";
}
@Override
public String[] supportedEvents() {
return new String[0];
}
}

BIN
src/main/resources/com/fr/plugin/parameter/slider/images/slider.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

1
src/main/resources/com/fr/plugin/parameter/slider/slider.properties

@ -0,0 +1 @@
Plugin-Slider_Name=Slider

1
src/main/resources/com/fr/plugin/parameter/slider/slider_zh_CN.properties

@ -0,0 +1 @@
Plugin-Slider_Name=\u6570\u503C\u6ED1\u5757

31
src/main/resources/com/fr/plugin/parameter/slider/web/slider.js

@ -0,0 +1,31 @@
(function ($) {
FR.ParameterSlider = FR.extend(FR.Widget, {
_defaultConfig: function () {
return $.extend(FR.ParameterSlider.superclass._defaultConfig.apply(), {
showWidth: 500,
showHeight: 280,
defaultWidth: 80
});
},
_init: function () {
FR.ParameterSlider.superclass._init.apply(this, arguments);
},
getValue: function () {
return this.options.value;
},
setValue: function (value) {
this.options.value = value;
},
setText: function (text) {
this.editComp.val(text);
},
getText: function () {
return this.editComp.val();
}
});
$.shortcut('parameter.slider', FR.ParameterSlider);
})(jQuery);
Loading…
Cancel
Save