174 lines
6.3 KiB
C#
174 lines
6.3 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Threading.Tasks;
|
|||
|
|
using System.ComponentModel;
|
|||
|
|
using CaeGlobals;
|
|||
|
|
using DynamicTypeDescriptor;
|
|||
|
|
using System.Drawing;
|
|||
|
|
|
|||
|
|
namespace CPSO.Settings
|
|||
|
|
{
|
|||
|
|
[Serializable]
|
|||
|
|
public class ViewPreSettings : IViewSettings, IReset
|
|||
|
|
{
|
|||
|
|
// Variables
|
|||
|
|
private PreSettings _preSettings;
|
|||
|
|
private DynamicCustomTypeDescriptor _dctd = null;
|
|||
|
|
|
|||
|
|
|
|||
|
|
// Properties
|
|||
|
|
[Category("Selection")]
|
|||
|
|
[OrderedDisplayName(0, 10, "Default geometry selection mode")]
|
|||
|
|
[Description("Select the default geometry selection mode.")]
|
|||
|
|
public GeometrySelectModeEnum GeometrySelectMode
|
|||
|
|
{
|
|||
|
|
get { return _preSettings.GeometrySelectMode; }
|
|||
|
|
set { _preSettings.GeometrySelectMode = value; }
|
|||
|
|
}
|
|||
|
|
//
|
|||
|
|
[Category("Selection")]
|
|||
|
|
[OrderedDisplayName(1, 10, "Primary highlight color")]
|
|||
|
|
[Description("Select the primary highlight color.")]
|
|||
|
|
public Color PrimaryHighlightColor
|
|||
|
|
{
|
|||
|
|
get { return _preSettings.PrimaryHighlightColor; }
|
|||
|
|
set { _preSettings.PrimaryHighlightColor = value; }
|
|||
|
|
}
|
|||
|
|
//
|
|||
|
|
[Category("Selection")]
|
|||
|
|
[OrderedDisplayName(2, 10, "Secondary highlight color")]
|
|||
|
|
[Description("Select the secondary highlight color.")]
|
|||
|
|
public Color SecondaryHighlightColor
|
|||
|
|
{
|
|||
|
|
get { return _preSettings.SecondaryHighlightColor; }
|
|||
|
|
set { _preSettings.SecondaryHighlightColor = value; }
|
|||
|
|
}
|
|||
|
|
//
|
|||
|
|
[Category("Selection")]
|
|||
|
|
[OrderedDisplayName(3, 10, "Mouse highlight color")]
|
|||
|
|
[Description("Select the mouse highlight color.")]
|
|||
|
|
public Color MouseHighlightColor
|
|||
|
|
{
|
|||
|
|
get { return _preSettings.MouseHighlightColor; }
|
|||
|
|
set { _preSettings.MouseHighlightColor = value; }
|
|||
|
|
}
|
|||
|
|
//
|
|||
|
|
[Category("Symbols")]
|
|||
|
|
[OrderedDisplayName(0, 10, "Constraint color")]
|
|||
|
|
[Description("Select the constraint symbol color.")]
|
|||
|
|
public Color ConstraintSymbolColor
|
|||
|
|
{
|
|||
|
|
get { return _preSettings.ConstraintSymbolColor; }
|
|||
|
|
set { _preSettings.ConstraintSymbolColor = value; }
|
|||
|
|
}
|
|||
|
|
//
|
|||
|
|
[Category("Symbols")]
|
|||
|
|
[OrderedDisplayName(1, 10, "Initial condition color")]
|
|||
|
|
[Description("Select the initial condition symbol color.")]
|
|||
|
|
public Color InitialConditionSymbolColor
|
|||
|
|
{
|
|||
|
|
get { return _preSettings.InitialConditionSymbolColor; }
|
|||
|
|
set { _preSettings.InitialConditionSymbolColor = value; }
|
|||
|
|
}
|
|||
|
|
//
|
|||
|
|
[Category("Symbols")]
|
|||
|
|
[OrderedDisplayName(2, 10, "Boundary condition color")]
|
|||
|
|
[Description("Select the boundary condition symbol color.")]
|
|||
|
|
public Color BoundaryConditionSymbolColor
|
|||
|
|
{
|
|||
|
|
get { return _preSettings.BoundaryConditionSymbolColor; }
|
|||
|
|
set { _preSettings.BoundaryConditionSymbolColor = value; }
|
|||
|
|
}
|
|||
|
|
//
|
|||
|
|
[Category("Symbols")]
|
|||
|
|
[OrderedDisplayName(3, 10, "Load color")]
|
|||
|
|
[Description("Select the load symbol color.")]
|
|||
|
|
public Color LoadSymbolColor
|
|||
|
|
{
|
|||
|
|
get { return _preSettings.LoadSymbolColor; }
|
|||
|
|
set { _preSettings.LoadSymbolColor = value; }
|
|||
|
|
}
|
|||
|
|
//
|
|||
|
|
[Category("Symbols")]
|
|||
|
|
[OrderedDisplayName(4, 10, "Defined field color")]
|
|||
|
|
[Description("Select the fefined field symbol color.")]
|
|||
|
|
public Color DefinedFieldSymbolColor
|
|||
|
|
{
|
|||
|
|
get { return _preSettings.DefinedFieldSymbolColor; }
|
|||
|
|
set { _preSettings.DefinedFieldSymbolColor = value; }
|
|||
|
|
}
|
|||
|
|
//
|
|||
|
|
[Category("Symbols")]
|
|||
|
|
[OrderedDisplayName(5, 10, "Symbol size")]
|
|||
|
|
[Description("Select the symbol size.")]
|
|||
|
|
[TypeConverter(typeof(StringLengthPixelConverter))]
|
|||
|
|
public int SymbolSize
|
|||
|
|
{
|
|||
|
|
get { return _preSettings.SymbolSize; }
|
|||
|
|
set { _preSettings.SymbolSize = value; }
|
|||
|
|
}
|
|||
|
|
//
|
|||
|
|
[Category("Symbols")]
|
|||
|
|
[OrderedDisplayName(6, 10, "Node symbol size")]
|
|||
|
|
[Description("Select the node symbol size.")]
|
|||
|
|
[TypeConverter(typeof(CaeGlobals.StringLengthPixelConverter))]
|
|||
|
|
public int NodeSymbolSize
|
|||
|
|
{
|
|||
|
|
get { return _preSettings.NodeSymbolSize; }
|
|||
|
|
set { _preSettings.NodeSymbolSize = value; }
|
|||
|
|
}
|
|||
|
|
//
|
|||
|
|
[Category("Symbols")]
|
|||
|
|
[OrderedDisplayName(7, 10, "Draw symbol edges")]
|
|||
|
|
[Description("Draw symbol edges.")]
|
|||
|
|
public bool DrawSymbolEdges
|
|||
|
|
{
|
|||
|
|
get { return _preSettings.DrawSymbolEdges; }
|
|||
|
|
set { _preSettings.DrawSymbolEdges = value; }
|
|||
|
|
}
|
|||
|
|
//
|
|||
|
|
[Category("Color bar")]
|
|||
|
|
[OrderedDisplayName(0, 10, "Background type")]
|
|||
|
|
[Description("Select the background type.")]
|
|||
|
|
public AnnotationBackgroundType ColorBarBackgroundType
|
|||
|
|
{
|
|||
|
|
get { return _preSettings.ColorBarBackgroundType; }
|
|||
|
|
set { _preSettings.ColorBarBackgroundType = value; }
|
|||
|
|
}
|
|||
|
|
//
|
|||
|
|
[Category("Color bar")]
|
|||
|
|
[OrderedDisplayName(1, 10, "Draw a border rectangle")]
|
|||
|
|
[Description("Draw a border rectangle around the legend.")]
|
|||
|
|
public bool ColorBarDrawBorder
|
|||
|
|
{
|
|||
|
|
get { return _preSettings.ColorBarDrawBorder; }
|
|||
|
|
set { _preSettings.ColorBarDrawBorder = value; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
// Constructors
|
|||
|
|
public ViewPreSettings(PreSettings preSettings)
|
|||
|
|
{
|
|||
|
|
_preSettings = preSettings;
|
|||
|
|
_dctd = ProviderInstaller.Install(this);
|
|||
|
|
// Now lets display Yes/No instead of True/False
|
|||
|
|
_dctd.RenameBooleanPropertyToYesNo(nameof(DrawSymbolEdges));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
// Methods
|
|||
|
|
public ISettings GetBase()
|
|||
|
|
{
|
|||
|
|
return _preSettings;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void Reset()
|
|||
|
|
{
|
|||
|
|
_preSettings.Reset();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|