|
|
|
@ -1,15 +1,14 @@
|
|
|
|
|
package com.fr.van.chart.gauge; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.utils.FineLayoutBuilder; |
|
|
|
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
|
|
|
import com.fr.chart.base.ChartConstants; |
|
|
|
|
import com.fr.chart.base.GradientStyle; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.style.background.gradient.FixedGradientBar; |
|
|
|
|
import com.fr.plugin.chart.type.GradientType; |
|
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
|
import com.fr.van.chart.designer.component.VanChartBeautyPane; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Component; |
|
|
|
@ -29,24 +28,18 @@ public class VanChartGaugeBeautyPane extends VanChartBeautyPane {
|
|
|
|
|
public VanChartGaugeBeautyPane() { |
|
|
|
|
super(); |
|
|
|
|
this.add(initGradientBarPane(), BorderLayout.SOUTH); |
|
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); |
|
|
|
|
initListener(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel initGradientBarPane() { |
|
|
|
|
colorGradient = new FixedGradientBar(4, 140); |
|
|
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
|
double[] columnSize = {f, e}; |
|
|
|
|
double[] rowSize = {p, p}; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
new Component[]{null, colorGradient}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
gradientBarPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); |
|
|
|
|
gradientBarPane = FineLayoutBuilder.commonLeftRightLayout(components); |
|
|
|
|
gradientBarPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); |
|
|
|
|
colorGradient.updateColor(ChartConstants.GRADIENT_END, ChartConstants.GRADIENT_START); |
|
|
|
|
return gradientBarPane; |
|
|
|
|
} |
|
|
|
|