private void UpdateCompensationIcon() { compensationIcon = Compensation ? IconFactory.CreateCompensation(false, IconColor) : null; }
private void UpdateLoopIcon() { loopIcon = IconFactory.CreateLoopCharacteristic(LoopCharacteristic, IconColor); }
private void UpdateActivityIcon() { activityIcon = IconFactory.CreateActivity(activityType, Background, Outline); }
private void UpdateAdHocIcon() { adHocIcon = AdHoc ? IconFactory.CreateAdHoc(IconColor) : null; }
private void UpdateIcon() { var multipleIcon = IconFactory.CreateLoopCharacteristic(LoopCharacteristic.Parallel, IconColor); multipleInstanceIcon = new PlacedIcon(multipleIcon, BpmnConstants.PoolNodeMarkerPlacement, BpmnConstants.MarkerSize); }
public NotificationViewModel(NotificationEventArgs e) { Time = DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss"); Message = e.Message; Icon = IconFactory.GetMessageImage(e.Type); }
private void UpdateTaskBandIcon() { taskBandBackgroundIcon = IconFactory.CreateChoreographyTaskBand(Background); }
public void GetIcon_FileInfo_Null() => Assert.That( IconFactory.Create(default(System.IO.FileInfo), IconSize.Large).Width, Is.EqualTo(32) );
private void UpdateArrow(EdgeType type) { switch (type) { case EdgeType.ConditionalFlow: delegateStyle.SourceArrow = new IconArrow(IconFactory.CreateArrowIcon(ArrowType.ConditionalSource, Color)) { Bounds = new SizeD(16, 8), CropLength = 0, Length = 16 }; delegateStyle.TargetArrow = new IconArrow(IconFactory.CreateArrowIcon(ArrowType.DefaultTarget, Color)) { Bounds = new SizeD(8, 6), CropLength = 0, Length = 8 }; break; case EdgeType.Association: delegateStyle.SourceArrow = Arrows.None; delegateStyle.TargetArrow = Arrows.None; break; case EdgeType.DirectedAssociation: delegateStyle.SourceArrow = Arrows.None; delegateStyle.TargetArrow = new IconArrow(IconFactory.CreateArrowIcon(ArrowType.Association, Color)) { Bounds = new SizeD(8, 6), CropLength = 0, Length = 0 }; break; case EdgeType.BidirectedAssociation: delegateStyle.SourceArrow = new IconArrow(IconFactory.CreateArrowIcon(ArrowType.Association, Color)) { Bounds = new SizeD(8, 6), CropLength = 0, Length = 0 }; delegateStyle.TargetArrow = new IconArrow(IconFactory.CreateArrowIcon(ArrowType.Association, Color)) { Bounds = new SizeD(8, 6), CropLength = 0, Length = 0 }; break; case EdgeType.MessageFlow: delegateStyle.SourceArrow = new IconArrow(IconFactory.CreateArrowIcon(ArrowType.MessageSource, Color)) { Bounds = new SizeD(6, 6), CropLength = 0, Length = 6 }; delegateStyle.TargetArrow = new IconArrow(IconFactory.CreateArrowIcon(ArrowType.MessageTarget, Color)) { Bounds = new SizeD(8, 6), CropLength = 0, Length = 8 }; break; case EdgeType.DefaultFlow: delegateStyle.SourceArrow = new IconArrow(IconFactory.CreateArrowIcon(ArrowType.DefaultSource, Color)) { Bounds = new SizeD(8, 6), CropLength = 0, Length = 0 }; delegateStyle.TargetArrow = new IconArrow(IconFactory.CreateArrowIcon(ArrowType.DefaultTarget, Color)) { Bounds = new SizeD(8, 6), CropLength = 0, Length = 8 }; break; case EdgeType.Conversation: delegateStyle.SourceArrow = Arrows.None; delegateStyle.TargetArrow = Arrows.None; break; case EdgeType.SequenceFlow: default: delegateStyle.SourceArrow = Arrows.None; delegateStyle.TargetArrow = new IconArrow(IconFactory.CreateArrowIcon(ArrowType.DefaultTarget, Color)) { Bounds = new SizeD(8, 6), CropLength = 0, Length = 8 }; break; } }
internal override void UpdateIcon(INode node) { Icon = IconFactory.CreateDataStore(Background, Outline); }
/// <summary> /// Updates the TreeView with the application structure /// </summary> protected void UpdateScadaApplicationsListTree() { // Check if a scada app was already loaded if (scadaApplication == null) { return; } // Clean tree view CleanTreeView(); // Definition of the icons to appear for the tree nodes Gdk.Pixbuf icnApplicationIcon = IconFactory.LookupDefault("ideas").RenderIcon(new Style(), TextDirection.None, StateType.Active, IconSize.Menu, null, null); Gdk.Pixbuf icnFolderIcon = IconFactory.LookupDefault("folder").RenderIcon(new Style(), TextDirection.None, StateType.Active, IconSize.Menu, null, null); Gdk.Pixbuf icnScreenIcon = IconFactory.LookupDefault("screen").RenderIcon(new Style(), TextDirection.None, StateType.Active, IconSize.Menu, null, null); Gdk.Pixbuf icnProjectIcon = IconFactory.LookupDefault("folder").RenderIcon(new Style(), TextDirection.None, StateType.Active, IconSize.Menu, null, null); Gdk.Pixbuf icnTagsWebserviceIcon = IconFactory.LookupDefault("tagswebservice").RenderIcon(new Style(), TextDirection.None, StateType.Active, IconSize.Menu, null, null); Gdk.Pixbuf icnTagsDatabaseIcon = IconFactory.LookupDefault("tagsdatabase").RenderIcon(new Style(), TextDirection.None, StateType.Active, IconSize.Menu, null, null); Gtk.CellRendererPixbuf cellIcon = new Gtk.CellRendererPixbuf(); Gtk.CellRendererText cellItem = new Gtk.CellRendererText(); TreeViewColumn colItem = new TreeViewColumn(); colItem.Title = "Application"; colItem.PackStart(cellIcon, false); colItem.AddAttribute(cellIcon, "pixbuf", 0); colItem.PackStart(cellItem, true); colItem.AddAttribute(cellItem, "text", 1); // Add column to the TreeView trvApplicationTreeView.AppendColumn(colItem); TreeStore applicationTreeStore = new TreeStore(typeof(Gdk.Pixbuf), typeof(string)); Gtk.TreeIter applicationIter = applicationTreeStore.AppendValues(new object[] { icnApplicationIcon, scadaApplication.Name }); foreach (Project project in scadaApplication.Projects) { Gtk.TreeIter projectIter = applicationTreeStore.AppendValues( applicationIter, new object[] { icnProjectIcon, project.Name }); Gtk.TreeIter screensIter = applicationTreeStore.AppendValues( projectIter, new object[] { icnFolderIcon, "Screens" }); foreach (Screen screen in project.Screens) { applicationTreeStore.AppendValues( screensIter, new object[] { icnScreenIcon, screen.Name }); } Gtk.TreeIter tagsDatabaseIter = applicationTreeStore.AppendValues( projectIter, new object[] { icnFolderIcon, "DataSources" }); foreach (DataSource datasource in project.Datasources) { applicationTreeStore.AppendValues( tagsDatabaseIter, new object[] { icnTagsDatabaseIcon, datasource.Name }); } Gtk.TreeIter tagsWebserviceIter = applicationTreeStore.AppendValues( projectIter, new object[] { icnFolderIcon, "WebService" }); applicationTreeStore.AppendValues( tagsWebserviceIter, new object[] { icnTagsWebserviceIcon, project.TagsWebService.Name }); } trvApplicationTreeView.Model = applicationTreeStore; trvApplicationTreeView.ExpandAll(); this.ShowAll(); }
public CollapseButtonIcon(INode node, Brush iconBrush) { this.node = node; collapsedIcon = IconFactory.CreateStaticSubState(SubState.Collapsed, iconBrush); expandedIcon = IconFactory.CreateStaticSubState(SubState.Expanded, iconBrush); }
public static void Load(string themePath) { if (themePath == null) { throw new ArgumentNullException("themePath"); } if (themePath.Length == 0) { throw new ArgumentException("Argument is empty", "themePath"); } // gtk requires an absolute path if (!Path.IsPathRooted(themePath)) { throw new ArgumentException("Path must be absolute", "themePath"); } if (!Directory.Exists(themePath)) { throw new DirectoryNotFoundException(string.Format("Path to theme \"{0}\" not found", themePath)); } //IconSize[] iconSizes = (IconSize[])Enum.GetValues(typeof(IconSize)); // all icon sizes the app uses IconSize[] iconSizes = { IconSize.Menu, /* 16px */ IconSize.LargeToolbar, /* 24px */ IconSize.Button, /* 24px */ IconSize.Dialog /* 48px */ }; Dictionary <string, string> iconNames = GetAllIconNames(); IconFactory fac = new IconFactory(); foreach (KeyValuePair <string, string> namePair in iconNames) { string name = namePair.Key; string nameInCustomTheme = namePair.Value; IconSet iconSet = new IconSet(); bool setHasSources = false; foreach (Gtk.IconSize size in iconSizes) { int sz = IconUtils.GetIconSizeVal(size); string fullPath = Path.Combine(Path.Combine(themePath, sz.ToString()), nameInCustomTheme); if (!File.Exists(fullPath)) { if (Global.EnableDebugging) { Debug.WriteLine(string.Format("IconTheme: could not find custom icon for \"{0}\" (size = {1}), using system default", name, sz)); } continue; } IconSource source = new IconSource(); #if LOAD_PIXBUFS source.Pixbuf = new Gdk.Pixbuf(fullPath); #else source.Filename = fullPath; #endif source.Size = size; //source.IconName = name; source.SizeWildcarded = false; iconSet.AddSource(source); setHasSources = true; } if (setHasSources) { fac.Add(name, iconSet); } } fac.AddDefault(); // add icon factory to the apps default factories }
internal IIcon CreateIcon(INode node) { var minimumWidth = 10.0; var icons = new List <IIcon>(); if (activityIcon != null) { icons.Add(activityIcon); } if (taskIcon != null) { icons.Add(taskIcon); } var lineUpIcons = new List <IIcon>(); if (loopIcon != null) { minimumWidth += BpmnConstants.MarkerSize.Width + 5; lineUpIcons.Add(loopIcon); } if (AdHoc) { minimumWidth += BpmnConstants.MarkerSize.Width + 5; lineUpIcons.Add(adHocIcon); } if (Compensation) { minimumWidth += BpmnConstants.MarkerSize.Width + 5; lineUpIcons.Add(compensationIcon); } if (SubState != SubState.None) { minimumWidth += BpmnConstants.MarkerSize.Width + 5; if (SubState == SubState.Dynamic) { lineUpIcons.Add(IconFactory.CreateDynamicSubState(node, IconColor)); } else { lineUpIcons.Add(IconFactory.CreateStaticSubState(SubState, IconColor)); } } if (lineUpIcons.Count > 0) { IIcon lineUpIcon = IconFactory.CreateLineUpIcon(lineUpIcons, BpmnConstants.MarkerSize, 5); icons.Add(IconFactory.CreatePlacedIcon(lineUpIcon, BpmnConstants.TaskMarkerPlacement, BpmnConstants.MarkerSize)); } MinimumSize = new SizeD(Math.Max(minimumWidth, 40), 40); if (icons.Count > 1) { return(IconFactory.CreateCombinedIcon(icons)); } else if (icons.Count == 1) { return(icons[0]); } else { return(null); } }
private void UpdateMessageLineIcon() { messageLineIcon = IconFactory.CreateLine(messageLinePen, 0.5, 0, 0.5, 1); }
internal override void UpdateIcon(INode node) { Icon = IconFactory.CreateAnnotation(Left, Background, Outline); }
private IIcon CreateTaskBandIcon(INode node) { if (taskBandBackgroundIcon == null) { UpdateTaskBandIcon(); } IIcon subStateIcon = null; if (SubState != SubState.None) { subStateIcon = SubState == SubState.Dynamic ? IconFactory.CreateDynamicSubState(node, IconColor) : IconFactory.CreateStaticSubState(SubState, IconColor); } IIcon markerIcon = null; if (loopIcon != null && subStateIcon != null) { markerIcon = IconFactory.CreateLineUpIcon(new List <IIcon>(new [] { loopIcon, subStateIcon }), BpmnConstants.MarkerSize, 5); } else if (loopIcon != null) { markerIcon = loopIcon; } else if (subStateIcon != null) { markerIcon = subStateIcon; } if (markerIcon != null) { var placedMarkers = IconFactory.CreatePlacedIcon(markerIcon, BpmnConstants.ChoreographyMarkerPlacement, BpmnConstants.MarkerSize); return(IconFactory.CreateCombinedIcon(new List <IIcon>(new[] { taskBandBackgroundIcon, placedMarkers }))); } else { return(taskBandBackgroundIcon); } }
public void GetIcon_Information_Null() => Assert.That( IconFactory.Create(default(FileSystem.Entity), IconSize.Large).Width, Is.EqualTo(32) );
private void UpdateGatewayIcon() { gatewayIcon = IconFactory.CreatePlacedIcon(IconFactory.CreateGateway(Background, Outline), BpmnConstants.GatewayPlacement, SizeD.Empty); }