소스 검색

【属性面板】填写与签名KMAnnotationSelfSignViewController类补充

wanjun 1 년 전
부모
커밋
6130138519

+ 16 - 0
PDF Office/PDF Master.xcodeproj/project.pbxproj

@@ -883,6 +883,12 @@
 		9FB220FA2B186C9800A5B208 /* KMAnnotationGeneralViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9FB220F62B186C9800A5B208 /* KMAnnotationGeneralViewController.xib */; };
 		9FB220FB2B186C9800A5B208 /* KMAnnotationGeneralViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9FB220F62B186C9800A5B208 /* KMAnnotationGeneralViewController.xib */; };
 		9FB220FC2B186C9800A5B208 /* KMAnnotationGeneralViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9FB220F62B186C9800A5B208 /* KMAnnotationGeneralViewController.xib */; };
+		9FB220FF2B18866E00A5B208 /* KMAnnotationSelfSignViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FB220FD2B18866E00A5B208 /* KMAnnotationSelfSignViewController.swift */; };
+		9FB221002B18866E00A5B208 /* KMAnnotationSelfSignViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FB220FD2B18866E00A5B208 /* KMAnnotationSelfSignViewController.swift */; };
+		9FB221012B18866E00A5B208 /* KMAnnotationSelfSignViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FB220FD2B18866E00A5B208 /* KMAnnotationSelfSignViewController.swift */; };
+		9FB221022B18866E00A5B208 /* KMAnnotationSelfSignViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9FB220FE2B18866E00A5B208 /* KMAnnotationSelfSignViewController.xib */; };
+		9FB221032B18866E00A5B208 /* KMAnnotationSelfSignViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9FB220FE2B18866E00A5B208 /* KMAnnotationSelfSignViewController.xib */; };
+		9FB221042B18866E00A5B208 /* KMAnnotationSelfSignViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9FB220FE2B18866E00A5B208 /* KMAnnotationSelfSignViewController.xib */; };
 		9FBA0EE128FEC253001117AF /* KMProductPromotionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FBA0EDF28FEC253001117AF /* KMProductPromotionViewController.swift */; };
 		9FBA0EE228FEC253001117AF /* KMProductPromotionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FBA0EDF28FEC253001117AF /* KMProductPromotionViewController.swift */; };
 		9FBA0EE328FEC253001117AF /* KMProductPromotionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FBA0EDF28FEC253001117AF /* KMProductPromotionViewController.swift */; };
@@ -4497,6 +4503,8 @@
 		9FB220F02B1863C800A5B208 /* KMAnnotationFromSignature.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMAnnotationFromSignature.swift; sourceTree = "<group>"; };
 		9FB220F52B186C9800A5B208 /* KMAnnotationGeneralViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMAnnotationGeneralViewController.swift; sourceTree = "<group>"; };
 		9FB220F62B186C9800A5B208 /* KMAnnotationGeneralViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMAnnotationGeneralViewController.xib; sourceTree = "<group>"; };
+		9FB220FD2B18866E00A5B208 /* KMAnnotationSelfSignViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMAnnotationSelfSignViewController.swift; sourceTree = "<group>"; };
+		9FB220FE2B18866E00A5B208 /* KMAnnotationSelfSignViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMAnnotationSelfSignViewController.xib; sourceTree = "<group>"; };
 		9FBA0EDF28FEC253001117AF /* KMProductPromotionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMProductPromotionViewController.swift; sourceTree = "<group>"; };
 		9FBA0EE028FEC253001117AF /* KMProductPromotionViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMProductPromotionViewController.xib; sourceTree = "<group>"; };
 		9FBA0EE828FFC2FE001117AF /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
@@ -6266,6 +6274,8 @@
 				9F221ED629A9EC0900978A59 /* KMFillSignTextPanel.xib */,
 				9FD0FA2F29CD947000F2AB0D /* KMOpacityPanel.swift */,
 				9FD0FA3029CD947000F2AB0D /* KMOpacityPanel.xib */,
+				9FB220FD2B18866E00A5B208 /* KMAnnotationSelfSignViewController.swift */,
+				9FB220FE2B18866E00A5B208 /* KMAnnotationSelfSignViewController.xib */,
 				9FB220F42B186C2900A5B208 /* FormProperties */,
 			);
 			path = ViewController;
@@ -10928,6 +10938,7 @@
 				BB897237294B38DC0045787C /* KMWatermarkAdjectivePropertyBaseController.xib in Resources */,
 				BB2EDF4F296E63E5003BCF58 /* KMPageEditInsertCustomPageWindowController.xib in Resources */,
 				89E4E7412964160F002DBA6F /* KMAnnotationLinkViewController.xib in Resources */,
+				9FB221022B18866E00A5B208 /* KMAnnotationSelfSignViewController.xib in Resources */,
 				9F1FE3F4293F4F0F00E952CA /* Info.plist in Resources */,
 				BB69C962299116FD0001A9B1 /* horizontal_line.pdf in Resources */,
 				BB7F7C0329AA586900A3E4E7 /* signAddBack.png in Resources */,
@@ -11619,6 +11630,7 @@
 				AD3AAD572B0D87E500DE5FE7 /* KMCompareThumbItem.xib in Resources */,
 				9F0CB4AB296CF19600007028 /* KMPropertiesPanelListMenuSubVC.xib in Resources */,
 				9F1F82B8292DEF370092C4B4 /* KMCloudDocumentsViewController.xib in Resources */,
+				9FB221032B18866E00A5B208 /* KMAnnotationSelfSignViewController.xib in Resources */,
 				9F0201922A1DDAA500C9B673 /* KMAITranslationWindowController.xib in Resources */,
 				BBE9D09C2AF0CEEB002E83CE /* KMBatchOperateCompressViewController.xib in Resources */,
 				AD0FA50729A8E61B00EDEB50 /* KMLightMemberAlertView.xib in Resources */,
@@ -11720,6 +11732,7 @@
 				BB69C961299116FD0001A9B1 /* plaid.pdf in Resources */,
 				9F0CB4AC296CF19600007028 /* KMPropertiesPanelListMenuSubVC.xib in Resources */,
 				ADB2D6FF294882B70029D2B3 /* KMTextFieldStepperView.xib in Resources */,
+				9FB221042B18866E00A5B208 /* KMAnnotationSelfSignViewController.xib in Resources */,
 				BB7648EA29ECECBF00931039 /* Color.xcassets in Resources */,
 				ADD1B6F22946C06C00C3FFF7 /* KMPrintChoosePageSizeSizeView.xib in Resources */,
 				AD1CA4162A061CCD0070541F /* KMAnnotationScreenColorViewItem.xib in Resources */,
@@ -12308,6 +12321,7 @@
 				89D9897428FE743E003A3E87 /* KMOutlineView.swift in Sources */,
 				AD5999362AD7D9C200412F8B /* KMPropertiesViewPopController.swift in Sources */,
 				BB6719F92AD2CC05003D44D5 /* CPDFSignatureWidgetAnnotation+PDFListView.swift in Sources */,
+				9FB220FF2B18866E00A5B208 /* KMAnnotationSelfSignViewController.swift in Sources */,
 				ADDEEA7A2AD3F4C800EF675D /* KMPopUpButton.swift in Sources */,
 				BB1BFF792AEA0B8E003EB179 /* KMBatchOperateRightViewController.swift in Sources */,
 				ADAFDA282AE8DE1B00F084BC /* KMAdvertisementModelTransition.swift in Sources */,
@@ -13390,6 +13404,7 @@
 				BBD512A22B0DE86C005BFE8A /* KMBotaLeftView.swift in Sources */,
 				AD1D481A2AFB6B96007AC1F0 /* KMMergeWindowController.swift in Sources */,
 				BB897276294DC04F0045787C /* KMWatermartAdjectivePageRangeView.swift in Sources */,
+				9FB221002B18866E00A5B208 /* KMAnnotationSelfSignViewController.swift in Sources */,
 				ADBC373329CA95AA00D93208 /* KMComparativeModel.swift in Sources */,
 				ADE86A932B0226AD00414DFA /* KMRemovePasswordView.swift in Sources */,
 				BBF62C712B0347AF007B7E86 /* SplitWindowController.swift in Sources */,
@@ -14483,6 +14498,7 @@
 				BB146FB9299DC0D100784A6A /* GTLRRuntimeCommon.m in Sources */,
 				BB147013299DC0D100784A6A /* OIDError.m in Sources */,
 				BB46CF4E2AFBB34900281EDF /* AutoSaveManager.swift in Sources */,
+				9FB221012B18866E00A5B208 /* KMAnnotationSelfSignViewController.swift in Sources */,
 				9F0CB4BF2977C06300007028 /* KMPropertiesPanelColorSubVC.swift in Sources */,
 				ADD1B6BD29420B4A00C3FFF7 /* KMPrintPreviewView.swift in Sources */,
 				BB146FF2299DC0D100784A6A /* GTLRUploadParameters.m in Sources */,

+ 94 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/View/KMSelfSignAnnotation.swift

@@ -172,5 +172,99 @@ import Quartz
         
         return path
     }
+    
+    // 根据样式获取缓存的颜色
+    static func fetchStoredColor(_ type: CAnnotationType) -> NSColor {
+        var color = NSColor.clear
+        
+        if type == .signDot {
+            color = UserDefaults.standard.color(forKey: "SKAnnotationSelfSignDotColorKey") ?? NSColor.clear
+        } else if type == .signLine {
+            color = UserDefaults.standard.color(forKey: "SKAnnotationSelfSignLineColorKey") ?? NSColor.clear
+        } else if type == .signCircle {
+            color = UserDefaults.standard.color(forKey: "SKAnnotationSelfSignCircleColorKey") ?? NSColor.clear
+        } else if type == .signFalse {
+            color = UserDefaults.standard.color(forKey: "SKAnnotationSelfSignFalseColorKey") ?? NSColor.clear
+        } else if type == .signTure {
+            color = UserDefaults.standard.color(forKey: "SKAnnotationSelfSignTureColorKey") ?? NSColor.clear
+        }
+        
+        return color
+    }
+
+    static func fetchStoredLineWidth(_ type: CAnnotationType) -> CGFloat {
+        var rtnLineWidth: CGFloat = 0
+        
+        if type == .signDot {
+            rtnLineWidth = CGFloat(UserDefaults.standard.float(forKey: "SKAnnotationSelfSignDotLineWidthKey"))
+        } else if type == .signLine {
+            rtnLineWidth = CGFloat(UserDefaults.standard.float(forKey: "SKAnnotationSelfSignLineLineWidthKey"))
+        } else if type == .signCircle {
+            rtnLineWidth = CGFloat(UserDefaults.standard.float(forKey: "SKAnnotationSelfSignCircleLineWidthKey"))
+        } else if type == .signFalse {
+            rtnLineWidth = CGFloat(UserDefaults.standard.float(forKey: "SKAnnotationSelfSignTureLineWidthKey"))
+        } else if type == .signTure {
+            rtnLineWidth = CGFloat(UserDefaults.standard.float(forKey: "SKAnnotationSelfSignTureLineWidthKey"))
+        }
+        
+        if rtnLineWidth == 0.0 {
+            changeStoredLineWidth(type, lineWidth: 0.8)
+            rtnLineWidth = 0.8
+        }
+        
+        return rtnLineWidth
+    }
+    
+    // 修改缓存的颜色
+    static func changeStoredColor(_ type: CAnnotationType, color newColor: NSColor) {
+        guard newColor.numberOfComponents > 0 else {
+            return
+        }
 
+        let userDefaults = UserDefaults.standard
+        if type == .signDot {
+            userDefaults.setColor(newColor, forKey: "SKAnnotationSelfSignDotColorKey")
+        } else if type == .signLine {
+            userDefaults.setColor(newColor, forKey: "SKAnnotationSelfSignLineColorKey")
+        } else if type == .signCircle {
+            userDefaults.setColor(newColor, forKey: "SKAnnotationSelfSignCircleColorKey")
+        } else if type == .signFalse {
+            userDefaults.setColor(newColor, forKey: "SKAnnotationSelfSignFalseColorKey")
+        } else if type == .signTure {
+            userDefaults.setColor(newColor, forKey: "SKAnnotationSelfSignTrueColorKey")
+        }
+    }
+    
+    static func changeStoredLineWidth(_ type: CAnnotationType, lineWidth: CGFloat) {
+        let userDefaults = UserDefaults.standard
+        
+        if type == .signDot {
+            userDefaults.set(lineWidth, forKey: "SKAnnotationSelfSignDotLineWidthKey")
+        } else if type == .signLine {
+            userDefaults.set(lineWidth, forKey: "SKAnnotationSelfSignLineLineWidthKey")
+        } else if type == .signCircle {
+            userDefaults.set(lineWidth, forKey: "SKAnnotationSelfSignCircleLineWidthKey")
+        } else if type == .signFalse {
+            userDefaults.set(lineWidth, forKey: "SKAnnotationSelfSignFalseLineWidthKey")
+        } else if type == .signTure {
+            userDefaults.set(lineWidth, forKey: "SKAnnotationSelfSignTrueLineWidthKey")
+        }
+    }
+    
+    static func fetchSelfSignTypeString(_ type: CAnnotationType) -> String {
+        var returnString = ""
+        
+        if type == .signFalse {
+            returnString = NSLocalizedString("X", comment: "")
+        } else if type == .signTure {
+            returnString = NSLocalizedString("Check mark", comment: "")
+        } else if type == .signCircle {
+            returnString = NSLocalizedString("Circle", comment: "")
+        } else if type == .signLine {
+            returnString = NSLocalizedString("Line", comment: "")
+        } else if type == .signDot {
+            returnString = NSLocalizedString("Dot", comment: "")
+        }
+        return returnString
+    }
 }

+ 416 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/KMAnnotationSelfSignViewController.swift

@@ -0,0 +1,416 @@
+//
+//  KMAnnotationSelfSignViewController.swift
+//  PDF Master
+//
+//  Created by wanjun on 2023/11/30.
+//
+
+import Cocoa
+
+typealias KMAnnotationSelfSignViewControllerCallBack = (CAnnotationType) -> Void
+
+class KMAnnotationSelfSignViewController: NSViewController {
+
+    var _annotations: [KMSelfSignAnnotation]?
+    var selfSignType: CAnnotationType = .signText
+    var pdfview: CPDFListView?
+    var callBack: KMAnnotationSelfSignViewControllerCallBack?
+    
+    @IBOutlet var colorLabel: NSTextField!
+    @IBOutlet var imageBox: NSBox!
+    @IBOutlet var imageBoxTop: NSLayoutConstraint!
+    
+    @IBOutlet var colorPickView: KMColorPickerView!
+    @IBOutlet var opacitySlider: NSSlider!
+    @IBOutlet var opacityComboBox: KMComboBox!
+    @IBOutlet var selfSignTypeLabel: NSTextField!
+    @IBOutlet var opacityLabel: NSTextField!
+    @IBOutlet var imageView: NSImageView!
+    @IBOutlet var falseTypeButton: NSButton!
+    @IBOutlet var trueTypeButton: NSButton!
+    @IBOutlet var circletypeButton: NSButton!
+    @IBOutlet var lineTypeButton: NSButton!
+    @IBOutlet var dotTypeButton: NSButton!
+    @IBOutlet var bottomView: NSView!
+    
+    @IBOutlet var lineWidthLabel: NSTextField!
+    @IBOutlet var lineWidthComboBox: KMComboBox!
+    @IBOutlet var lineWidthSlider: NSSlider!
+    @IBOutlet var lineWidthView: NSView!
+    @IBOutlet var lineWidthViewTopConstraint: NSLayoutConstraint!
+    
+    @IBOutlet var widthView: NSView!
+    
+    var annotation: KMSelfSignAnnotation?
+
+    // MARK: Life Cycle
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+    }
+    
+    override func loadView() {
+        super.loadView()
+        
+        colorLabel.stringValue = NSLocalizedString("Color", comment: "")
+        colorLabel.textColor = KMAppearance.Layout.h0Color()
+        opacityLabel.stringValue = NSLocalizedString("Opacity", comment: "")
+        opacityLabel.textColor = KMAppearance.Layout.h1Color()
+        selfSignTypeLabel.stringValue = NSLocalizedString("Type", comment: "")
+        selfSignTypeLabel.textColor = KMAppearance.Layout.h0Color()
+        lineWidthLabel.stringValue = NSLocalizedString("Line Width", comment: "")
+        lineWidthLabel.textColor = KMAppearance.Layout.h0Color()
+        colorPickView.noContentString = true
+        colorPickView.annotationTypeString = NSLocalizedString("Color", comment: "")
+        imageBox.borderColor = KMAppearance.Interactive.s0Color()
+        imageBox.borderWidth = 1.0
+        imageBox.fillColor = KMAppearance.Layout.l1Color()
+
+        var color: NSColor?
+        if let annotation = annotation {
+            selfSignType = annotation.annotationType
+            typeSelected(selfSignType)
+
+            color = annotation.lineColor
+            lineWidthSlider.floatValue = Float(annotation.lineWidth())
+            lineWidthComboBox.stringValue = String(format: "%.1f pt", lineWidthSlider.floatValue)
+        } else {
+            bottomView.isHidden = true
+            color = KMSelfSignAnnotation.fetchStoredColor(selfSignType)
+            lineWidthSlider.floatValue = Float(KMSelfSignAnnotation.fetchStoredLineWidth(selfSignType))
+            lineWidthComboBox.stringValue = String(format: "%.1f pt", lineWidthSlider.floatValue)
+        }
+
+        colorPickView.color = color
+        var opacity: CGFloat = 1.0
+        color?.usingColorSpaceName(.calibratedRGB)?.getRed(nil, green: nil, blue: nil, alpha: &opacity)
+        opacityComboBox.stringValue = "\(Int(opacity * 100))%"
+        opacitySlider.floatValue = Float(opacity)
+        imageView.image = drawImage(with: selfSignType)
+
+        // ComboBox Configuration
+        opacityComboBox.type = .none
+        opacityComboBox.comboxRect = opacityComboBox.bounds
+        lineWidthComboBox.type = .none
+        lineWidthComboBox.comboxRect = lineWidthComboBox.bounds
+        opacityComboBox.backgroundColor = KMAppearance.Layout.l1Color()
+        lineWidthComboBox.backgroundColor = KMAppearance.Layout.l1Color()
+        opacityComboBox.wantsLayer = true
+        lineWidthComboBox.wantsLayer = true
+        opacityComboBox.layer?.borderWidth = 1.0
+        lineWidthComboBox.layer?.borderWidth = 1.0
+
+        if selfSignType == .signDot {
+            lineWidthView.isHidden = true
+            lineWidthViewTopConstraint.constant = -6 - lineWidthView.bounds.size.height
+        }
+
+        if annotations.count > 1 {
+            imageBoxTop.constant = -imageBox.bounds.size.height
+            imageBox.isHidden = true
+        } else {
+            imageBoxTop.constant = 10
+            imageBox.isHidden = false
+        }
+
+        // PickView Configuration
+        colorPickView.annotationType = .selfSignColors
+        colorPickView.isCallColorPanelAction = true
+    }
+    
+    override func viewDidAppear() {
+        super.viewDidAppear()
+        
+        let showConvertDetails = KMPropertiesViewPopController.showChangeColorDetails()
+
+        if showConvertDetails, let document = view.window?.windowController?.document as? NSDocument,
+           let fileURL = document.fileURL {
+            KMPropertiesViewPopController.defaultManager().showChangeColorDetailsView(colorPickView.firstButton)
+        }
+    }
+    
+    // MARK: Set & Get
+    
+    var annotations: [KMSelfSignAnnotation] {
+        set {
+            _annotations = newValue
+            
+            annotation = newValue.first
+        }
+        get {
+            return _annotations!
+        }
+    }
+    
+    // MARK: Private Method
+    
+    func drawImage(with type: CAnnotationType) -> NSImage? {
+        let imageSize = NSSize(width: 50, height: 50)
+        guard imageSize.width != 0 && imageSize.height != 0 else {
+            return nil
+        }
+        
+        let image = NSImage(size: imageSize)
+        
+        let bounds = NSRect(x: 0, y: 0, width: 50, height: 50)
+        image.lockFocus()
+        NSGraphicsContext.current?.imageInterpolation = .high
+        guard let context = NSGraphicsContext.current?.cgContext else {
+            image.unlockFocus()
+            return nil
+        }
+        
+        var paintColor: NSColor
+        var lineWidth: CGFloat
+        if let annotation = annotation {
+            paintColor = annotation.lineColor
+            lineWidth = annotation.lineAnnotationWidth
+        } else {
+            paintColor = KMSelfSignAnnotation.fetchStoredColor(type)
+            lineWidth = KMSelfSignAnnotation.fetchStoredLineWidth(type)
+        }
+        
+        if type == .signTure {
+            context.move(to: CGPoint(x: bounds.minX + lineWidth/2, y: bounds.midY + lineWidth/2))
+            context.addLine(to: CGPoint(x: bounds.minX + bounds.width/3.0, y: bounds.minY + lineWidth/2))
+            context.addLine(to: CGPoint(x: bounds.maxX - lineWidth/2, y: bounds.maxY - lineWidth/2))
+            context.setLineWidth(lineWidth)
+            context.setStrokeColor(paintColor.cgColor)
+            context.setFillColor(paintColor.cgColor)
+            context.strokePath()
+        } else if type == .signFalse {
+            context.move(to: CGPoint(x: bounds.minX + lineWidth/2, y: bounds.minY + lineWidth/2))
+            context.addLine(to: CGPoint(x: bounds.maxX - lineWidth/2, y: bounds.maxY - lineWidth/2))
+            context.setLineWidth(lineWidth)
+            context.setStrokeColor(paintColor.cgColor)
+            context.setFillColor(paintColor.cgColor)
+            context.strokePath()
+            context.move(to: CGPoint(x: bounds.minX + lineWidth/2, y: bounds.maxY - lineWidth/2))
+            context.addLine(to: CGPoint(x: bounds.maxX - lineWidth/2, y: bounds.minY + lineWidth/2))
+            context.setStrokeColor(paintColor.cgColor)
+            context.setFillColor(paintColor.cgColor)
+            context.strokePath()
+        } else if type == .signLine {
+            let path = NSBezierPath(roundedRect: NSRect(x: bounds.minX + 1, y: bounds.midY - lineWidth/2, width: bounds.width - 2, height: lineWidth), xRadius: lineWidth/2.0, yRadius: lineWidth/2.0)
+            paintColor.set()
+            path.fill()
+        } else if type == .signCircle {
+            let r = min(bounds.width, bounds.height)/3.0
+            let path = NSBezierPath(roundedRect: bounds.insetBy(dx: lineWidth/2, dy: lineWidth/2), xRadius: r, yRadius: r)
+            
+            path.lineWidth = lineWidth
+            paintColor.set()
+            path.stroke()
+        } else if type == .signDot {
+            context.setStrokeColor(NSColor.black.cgColor)
+            context.setLineWidth(1.0)
+            context.addArc(center: CGPoint(x: bounds.midX, y: bounds.midY), radius: min(bounds.width/2.0 - 1, bounds.height/2.0 - 1), startAngle: 0, endAngle: CGFloat.pi * 2, clockwise: true)
+            
+            context.setStrokeColor(paintColor.cgColor)
+            context.setFillColor(paintColor.cgColor)
+            context.fillPath()
+        }
+        image.unlockFocus()
+        return image
+    }
+    
+    func typeSelected(_ type: CAnnotationType) {
+        let buttons: [NSButton] = [falseTypeButton, trueTypeButton, circletypeButton, lineTypeButton, dotTypeButton]
+        
+        buttons.forEach { button in
+            button.wantsLayer = true
+            button.layer?.backgroundColor = NSColor.clear.cgColor
+            button.layer?.cornerRadius = 4.0
+        }
+        
+        falseTypeButton.image = NSImage(named: KMImageNameSelfSignFalseSel)
+        trueTypeButton.image = NSImage(named: KMImageNameSelfSignTureSel)
+        circletypeButton.image = NSImage(named: KMImageNameSelfSignCircleSel)
+        lineTypeButton.image = NSImage(named: KMImageNameSelfSignLineSel)
+        dotTypeButton.image = NSImage(named: KMImageNameSelfSignDotSel)
+        
+        if type == .signFalse {
+            falseTypeButton.layer?.backgroundColor = KMAppearance.Status.selColor().cgColor
+            falseTypeButton.image = NSImage(named: KMImageNameSelfSignFalse)
+        } else if type == .signTure {
+            trueTypeButton.layer?.backgroundColor = KMAppearance.Status.selColor().cgColor
+            trueTypeButton.image = NSImage(named: KMImageNameSelfSignTure)
+        } else if type == .signCircle {
+            circletypeButton.layer?.backgroundColor = KMAppearance.Status.selColor().cgColor
+            circletypeButton.image = NSImage(named: KMImageNameSelfSignCircle)
+        } else if type == .signLine {
+            lineTypeButton.layer?.backgroundColor = KMAppearance.Status.selColor().cgColor
+            lineTypeButton.image = NSImage(named: KMImageNameSelfSignLine)
+        } else if type == .signDot {
+            dotTypeButton.layer?.backgroundColor = KMAppearance.Status.selColor().cgColor
+            dotTypeButton.image = NSImage(named: KMImageNameSelfSignDot)
+        }
+    }
+    
+    // MARK: Outlet Methods
+    
+    @IBAction func opacityComboboxAction(_ sender: NSComboBox) {
+        var originalColor: NSColor
+        
+        if let annotation = annotation {
+            originalColor = annotation.lineColor
+        } else {
+            originalColor = KMSelfSignAnnotation.fetchStoredColor(selfSignType)
+        }
+        
+        var red: CGFloat = 0.0
+        var green: CGFloat = 0.0
+        var blue: CGFloat = 0.0
+        var opacity: CGFloat = 0.0
+        
+        originalColor.usingColorSpaceName(.calibratedRGB)?.getRed(&red, green: &green, blue: &blue, alpha: &opacity)
+
+        switch sender.stringValue {
+        case "25%":
+            opacity = 0.25
+        case "50%":
+            opacity = 0.5
+        case "75%":
+            opacity = 0.75
+        case "100%":
+            opacity = 1.0
+        default:
+            break
+        }
+        
+        opacitySlider.doubleValue = Double(opacity)
+        opacityComboBox.stringValue = "\(Int(opacity * 100))%"
+        
+        let newColor = NSColor(calibratedRed: red, green: green, blue: blue, alpha: opacity)
+        
+        if let annotation = annotation {
+            for tAnnotation in annotations {
+                tAnnotation.lineColor = newColor
+            }
+            pdfview?.needsDisplay = true
+        } else {
+            KMSelfSignAnnotation.changeStoredColor(selfSignType, color: newColor)
+        }
+        
+        colorPickView.color = newColor
+        imageView.image = drawImage(with: selfSignType)
+    }
+    
+    @IBAction func colorPickViewAction(_ sender: Any) {
+        if let annotation = annotation {
+            for tAnnotation in annotations {
+                tAnnotation.lineColor = colorPickView.color!
+            }
+            pdfview?.needsDisplay = true
+        } else {
+            KMSelfSignAnnotation.changeStoredColor(selfSignType, color: colorPickView.color!)
+        }
+        imageView.image = drawImage(with: selfSignType)
+    }
+    
+    @IBAction func opacitySliderAction(_ sender: Any) {
+        var originalColor: NSColor?
+
+        if let annotation = annotation {
+            originalColor = annotation.lineColor
+        } else {
+            originalColor = KMSelfSignAnnotation.fetchStoredColor(selfSignType)
+        }
+
+        var red: CGFloat = 0.0, green: CGFloat = 0.0, blue: CGFloat = 0.0, opacity: CGFloat = 0.0
+        originalColor!.usingColorSpaceName(.calibratedRGB)?.getRed(&red, green: &green, blue: &blue, alpha: &opacity)
+
+        opacity = CGFloat(opacitySlider.floatValue)
+        opacityComboBox.stringValue = String(format: "%d%%", Int(opacity * 100))
+
+        let newColor = NSColor(calibratedRed: red, green: green, blue: blue, alpha: opacity)
+
+        if let annotation = annotation {
+            for tAnnotation in annotations {
+                tAnnotation.lineColor = newColor
+            }
+            pdfview?.needsDisplay = true
+        } else {
+            KMSelfSignAnnotation.changeStoredColor(selfSignType, color: newColor)
+        }
+
+        imageView.image = drawImage(with: selfSignType)
+        colorPickView.color = newColor
+    }
+    
+    @IBAction func lineWidthSliderAction(_ sender: NSSlider) {
+        if let annotation = annotation {
+            for tAnnotation in annotations {
+                tAnnotation.lineAnnotationWidth = CGFloat(sender.floatValue)
+            }
+        } else {
+            KMSelfSignAnnotation.changeStoredLineWidth(selfSignType, lineWidth: CGFloat(sender.floatValue))
+        }
+        
+        lineWidthComboBox.stringValue = String(format: "%.1f pt", sender.floatValue)
+        imageView.image = drawImage(with: selfSignType)
+    }
+
+    @IBAction func lineWidthComboboxAction(_ sender: NSComboBox) {
+        var lineWidth = sender.floatValue
+        if lineWidth > 18 {
+            lineWidth = 18
+        }
+        
+        if let annotation = annotation {
+            for tAnnotation in annotations {
+                tAnnotation.lineAnnotationWidth = CGFloat(lineWidth)
+            }
+        } else {
+            KMSelfSignAnnotation.changeStoredLineWidth(selfSignType, lineWidth: CGFloat(lineWidth))
+        }
+        
+        lineWidthSlider.floatValue = lineWidth
+        sender.stringValue = String(format: "%0.1f pt", lineWidth)
+        imageView.image = drawImage(with: selfSignType)
+    }
+    
+    @IBAction func buttonClickedTypeSwitch(_ sender: NSButton) {
+        let tag = sender.tag
+        
+        for tAnnotation in annotations {
+            if tag == 1 {
+                tAnnotation.annotationType = .signature
+            } else if tag == 2 {
+                tAnnotation.annotationType = .signFalse
+            } else {
+                tAnnotation.annotationType = CAnnotationType(rawValue: tag) ?? .unkown
+            }
+        }
+
+        var originalFrame = annotation!.bounds
+        if annotation!.annotationType == .signFalse ||
+            annotation!.annotationType == .signTure ||
+            annotation!.annotationType == .signLine ||
+            annotation!.annotationType == .signDot  {
+            originalFrame.size.width = min(originalFrame.size.width, originalFrame.size.height)
+            originalFrame.size.height = originalFrame.size.width
+            annotation!.bounds = originalFrame
+        } else if annotation!.annotationType == .signCircle {
+            annotation!.annotationType = .signCircle
+        }
+
+        pdfview?.needsDisplay = true
+        selfSignType = annotation!.annotationType
+        imageView.image = drawImage(with: selfSignType)
+        typeSelected(selfSignType)
+
+        if let callBack = callBack {
+            callBack(selfSignType)
+        }
+
+        if selfSignType == .signDot {
+            lineWidthView.isHidden = true
+            lineWidthViewTopConstraint.constant = -6 - lineWidthView.bounds.size.height
+        } else {
+            lineWidthView.isHidden = false
+            lineWidthViewTopConstraint.constant = 10
+        }
+    }
+}

+ 406 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/KMAnnotationSelfSignViewController.xib

@@ -0,0 +1,406 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMAnnotationSelfSignViewController">
+            <connections>
+                <outlet property="bottomView" destination="WyR-kR-Qty" id="wAo-5V-PWm"/>
+                <outlet property="circletypeButton" destination="ahQ-Ib-yZf" id="dcQ-jt-a4K"/>
+                <outlet property="colorLabel" destination="bhE-7k-rOU" id="bPH-6t-Ey7"/>
+                <outlet property="colorPickView" destination="N4p-PV-4Fm" id="yOI-DQ-kaj"/>
+                <outlet property="dotTypeButton" destination="lMG-VK-Xj4" id="OJP-V4-c0Y"/>
+                <outlet property="falseTypeButton" destination="6Qo-qg-occ" id="dlq-LE-LWl"/>
+                <outlet property="imageBox" destination="3UA-TF-eaK" id="JAb-oD-csh"/>
+                <outlet property="imageView" destination="eg8-wT-QVm" id="QzN-Fh-fdY"/>
+                <outlet property="lineTypeButton" destination="ycV-tn-Tcv" id="6od-Gp-UMw"/>
+                <outlet property="lineWidthComboBox" destination="aoL-Gs-1II" id="IAp-RF-5Jr"/>
+                <outlet property="lineWidthLabel" destination="S4i-am-pFd" id="kS7-q5-4AN"/>
+                <outlet property="lineWidthSlider" destination="hwe-qj-M4y" id="dJD-XQ-Ukr"/>
+                <outlet property="lineWidthView" destination="4d3-Eg-lwC" id="hQe-1n-C1Y"/>
+                <outlet property="lineWidthViewTopConstraint" destination="HSf-2b-MO3" id="MZe-ip-XEP"/>
+                <outlet property="opacityComboBox" destination="Sbs-rL-zfE" id="tkt-oz-Yia"/>
+                <outlet property="opacityLabel" destination="enu-GO-p3q" id="y0U-Tl-INl"/>
+                <outlet property="opacitySlider" destination="U8k-K1-qQT" id="uby-2z-GnQ"/>
+                <outlet property="selfSignTypeLabel" destination="x0t-6o-bFa" id="cq9-jU-KVL"/>
+                <outlet property="tureTypeButton" destination="Vu3-og-LXM" id="BDX-qm-61k"/>
+                <outlet property="view" destination="j0h-GU-ZZz" id="vbc-yH-dWN"/>
+                <outlet property="widthView" destination="4d3-Eg-lwC" id="e5B-Y6-3A6"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="j0h-GU-ZZz">
+            <rect key="frame" x="0.0" y="0.0" width="373" height="536"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="c5i-W5-32o" customClass="KMClipView">
+                <rect key="frame" x="0.0" y="0.0" width="373" height="536"/>
+                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                <subviews>
+                    <view translatesAutoresizingMaskIntoConstraints="NO" id="AnR-E3-pQh">
+                        <rect key="frame" x="0.0" y="135" width="373" height="401"/>
+                        <subviews>
+                            <box boxType="custom" borderWidth="0.0" cornerRadius="1" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="3UA-TF-eaK">
+                                <rect key="frame" x="16" y="321" width="341" height="80"/>
+                                <view key="contentView" id="Dpi-2b-J7j">
+                                    <rect key="frame" x="0.0" y="0.0" width="341" height="80"/>
+                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    <subviews>
+                                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="eg8-wT-QVm">
+                                            <rect key="frame" x="101" y="15" width="140" height="50"/>
+                                            <constraints>
+                                                <constraint firstAttribute="width" constant="140" id="8aY-fS-zrn"/>
+                                                <constraint firstAttribute="height" constant="50" id="HEX-Hd-4QU"/>
+                                            </constraints>
+                                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="g6r-kS-6ab"/>
+                                        </imageView>
+                                    </subviews>
+                                    <constraints>
+                                        <constraint firstItem="eg8-wT-QVm" firstAttribute="centerX" secondItem="Dpi-2b-J7j" secondAttribute="centerX" id="vox-2s-zS2"/>
+                                    </constraints>
+                                </view>
+                                <constraints>
+                                    <constraint firstItem="eg8-wT-QVm" firstAttribute="centerY" secondItem="3UA-TF-eaK" secondAttribute="centerY" id="99X-3s-LcI"/>
+                                    <constraint firstAttribute="height" constant="80" id="QOp-kg-Q2l"/>
+                                </constraints>
+                                <color key="fillColor" red="0.99999600649999998" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            </box>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="IL8-Yg-kZ6">
+                                <rect key="frame" x="16" y="239" width="341" height="72"/>
+                                <subviews>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bhE-7k-rOU">
+                                        <rect key="frame" x="-2" y="42" width="42" height="20"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="Wua-1h-geY"/>
+                                        </constraints>
+                                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Color" id="ngq-ff-xPZ">
+                                            <font key="font" metaFont="systemBold" size="14"/>
+                                            <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
+                                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                    </textField>
+                                    <customView placeholderIntrinsicWidth="240" placeholderIntrinsicHeight="26" translatesAutoresizingMaskIntoConstraints="NO" id="N4p-PV-4Fm" customClass="KMColorPickerView">
+                                        <rect key="frame" x="0.0" y="0.0" width="341" height="32"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="32" id="KbU-gi-MOC"/>
+                                        </constraints>
+                                        <connections>
+                                            <action selector="colorPickViewAction:" target="-2" id="Pcz-qX-Za9"/>
+                                        </connections>
+                                    </customView>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="bhE-7k-rOU" firstAttribute="leading" secondItem="IL8-Yg-kZ6" secondAttribute="leading" id="4VV-56-VI5"/>
+                                    <constraint firstItem="N4p-PV-4Fm" firstAttribute="top" secondItem="bhE-7k-rOU" secondAttribute="bottom" constant="10" id="6Jd-e1-DY4"/>
+                                    <constraint firstAttribute="trailing" secondItem="N4p-PV-4Fm" secondAttribute="trailing" id="UyC-X0-NVV"/>
+                                    <constraint firstItem="bhE-7k-rOU" firstAttribute="top" secondItem="IL8-Yg-kZ6" secondAttribute="top" constant="10" id="fsL-2d-Sim"/>
+                                    <constraint firstItem="N4p-PV-4Fm" firstAttribute="leading" secondItem="IL8-Yg-kZ6" secondAttribute="leading" id="kb1-zN-gUW"/>
+                                    <constraint firstAttribute="bottom" secondItem="N4p-PV-4Fm" secondAttribute="bottom" id="svN-BP-MD1"/>
+                                </constraints>
+                            </customView>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="4d3-Eg-lwC">
+                                <rect key="frame" x="16" y="90" width="341" height="67"/>
+                                <subviews>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="S4i-am-pFd">
+                                        <rect key="frame" x="-2" y="37" width="345" height="20"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="ZkO-ja-q4K"/>
+                                        </constraints>
+                                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Width" id="hkN-SK-B6Y">
+                                            <font key="font" metaFont="systemBold" size="14"/>
+                                            <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
+                                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                    </textField>
+                                    <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hwe-qj-M4y">
+                                        <rect key="frame" x="-2" y="0.0" width="264" height="28"/>
+                                        <sliderCell key="cell" alignment="left" minValue="0.10000000000000001" maxValue="18" doubleValue="5.5906448622881353" tickMarkPosition="above" sliderType="linear" id="0GB-jo-rsP"/>
+                                        <connections>
+                                            <action selector="lineWidthSliderAction:" target="-2" id="A5d-d7-f2f"/>
+                                        </connections>
+                                    </slider>
+                                    <comboBox focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="aoL-Gs-1II" customClass="KMComboBox">
+                                        <rect key="frame" x="267" y="2" width="74" height="27"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="T2u-M7-u4V"/>
+                                            <constraint firstAttribute="width" constant="70" id="vSW-uF-pEs"/>
+                                        </constraints>
+                                        <comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" focusRingType="none" alignment="center" completes="NO" numberOfVisibleItems="7" id="JyP-1H-WzE" customClass="KMComboBoxCell">
+                                            <font key="font" metaFont="cellTitle"/>
+                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                            <objectValues>
+                                                <string>1 pt</string>
+                                                <string>3 pt</string>
+                                                <string>6 pt</string>
+                                                <string>9 pt</string>
+                                                <string>12 pt</string>
+                                                <string>15 pt</string>
+                                                <string>18 pt</string>
+                                            </objectValues>
+                                        </comboBoxCell>
+                                        <connections>
+                                            <action selector="lineWidthComboboxAction:" target="-2" id="v5D-4L-LJ1"/>
+                                        </connections>
+                                    </comboBox>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="aoL-Gs-1II" firstAttribute="leading" secondItem="hwe-qj-M4y" secondAttribute="trailing" constant="8" id="1lM-qO-PF2"/>
+                                    <constraint firstAttribute="trailing" secondItem="S4i-am-pFd" secondAttribute="trailing" id="HKX-or-FVv"/>
+                                    <constraint firstAttribute="trailing" secondItem="aoL-Gs-1II" secondAttribute="trailing" constant="3" id="IOs-lq-Bem"/>
+                                    <constraint firstItem="aoL-Gs-1II" firstAttribute="centerY" secondItem="hwe-qj-M4y" secondAttribute="centerY" id="cwq-eK-Ty5"/>
+                                    <constraint firstItem="aoL-Gs-1II" firstAttribute="top" secondItem="S4i-am-pFd" secondAttribute="bottom" constant="8.5500000000000007" id="ehE-bb-2ud"/>
+                                    <constraint firstAttribute="bottom" secondItem="aoL-Gs-1II" secondAttribute="bottom" constant="4" id="esA-6U-5yp"/>
+                                    <constraint firstItem="hwe-qj-M4y" firstAttribute="leading" secondItem="4d3-Eg-lwC" secondAttribute="leading" id="f3v-qb-INe"/>
+                                    <constraint firstItem="S4i-am-pFd" firstAttribute="leading" secondItem="4d3-Eg-lwC" secondAttribute="leading" id="mjC-MP-jda"/>
+                                    <constraint firstItem="S4i-am-pFd" firstAttribute="top" secondItem="4d3-Eg-lwC" secondAttribute="top" constant="10" id="whX-Rn-hdF"/>
+                                </constraints>
+                            </customView>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="vQ9-Zz-gOM">
+                                <rect key="frame" x="16" y="163" width="341" height="66"/>
+                                <subviews>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="enu-GO-p3q">
+                                        <rect key="frame" x="-2" y="36" width="51" height="20"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="0nK-1V-JLV"/>
+                                        </constraints>
+                                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Opacity" id="hjR-FC-gnJ">
+                                            <font key="font" metaFont="system"/>
+                                            <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
+                                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                    </textField>
+                                    <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="U8k-K1-qQT">
+                                        <rect key="frame" x="-2" y="0.0" width="264" height="28"/>
+                                        <sliderCell key="cell" state="on" alignment="left" maxValue="1" doubleValue="0.00087117805755395684" tickMarkPosition="above" sliderType="linear" id="Fo9-ah-xlf"/>
+                                        <connections>
+                                            <action selector="opacitySliderAction:" target="-2" id="fbd-rc-JlO"/>
+                                        </connections>
+                                    </slider>
+                                    <comboBox focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Sbs-rL-zfE" customClass="KMComboBox">
+                                        <rect key="frame" x="267" y="2" width="74" height="27"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="leo-Fd-Od0"/>
+                                            <constraint firstAttribute="width" constant="70" id="zMC-1W-3fd"/>
+                                        </constraints>
+                                        <comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" focusRingType="none" alignment="center" completes="NO" numberOfVisibleItems="5" id="47z-fL-nEk" customClass="KMComboBoxCell">
+                                            <font key="font" metaFont="cellTitle"/>
+                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                            <objectValues>
+                                                <string>25%</string>
+                                                <string>50%</string>
+                                                <string>75%</string>
+                                                <string>100%</string>
+                                            </objectValues>
+                                        </comboBoxCell>
+                                        <connections>
+                                            <action selector="opacityComboboxAction:" target="-2" id="yON-VD-kkV"/>
+                                        </connections>
+                                    </comboBox>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="U8k-K1-qQT" firstAttribute="leading" secondItem="vQ9-Zz-gOM" secondAttribute="leading" id="0Hr-93-RBN"/>
+                                    <constraint firstItem="U8k-K1-qQT" firstAttribute="top" secondItem="enu-GO-p3q" secondAttribute="bottom" constant="10" id="CGN-nC-uqS"/>
+                                    <constraint firstItem="enu-GO-p3q" firstAttribute="top" secondItem="vQ9-Zz-gOM" secondAttribute="top" constant="10" id="LL1-SK-dFD"/>
+                                    <constraint firstAttribute="bottom" secondItem="Sbs-rL-zfE" secondAttribute="bottom" constant="4" id="QsF-of-QVD"/>
+                                    <constraint firstItem="enu-GO-p3q" firstAttribute="leading" secondItem="vQ9-Zz-gOM" secondAttribute="leading" id="UJV-Dx-5wH"/>
+                                    <constraint firstAttribute="trailing" secondItem="Sbs-rL-zfE" secondAttribute="trailing" constant="3" id="V3V-gD-p58"/>
+                                    <constraint firstItem="Sbs-rL-zfE" firstAttribute="leading" secondItem="U8k-K1-qQT" secondAttribute="trailing" constant="8" id="VWa-OM-qgx"/>
+                                    <constraint firstItem="Sbs-rL-zfE" firstAttribute="centerY" secondItem="U8k-K1-qQT" secondAttribute="centerY" id="fRs-YW-1Qi"/>
+                                </constraints>
+                            </customView>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="WyR-kR-Qty">
+                                <rect key="frame" x="16" y="10" width="341" height="74"/>
+                                <subviews>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="x0t-6o-bFa">
+                                        <rect key="frame" x="-2" y="44" width="39" height="20"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="j0D-OU-A1b"/>
+                                        </constraints>
+                                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Type" id="YVd-BC-qSn">
+                                            <font key="font" metaFont="systemBold" size="14"/>
+                                            <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
+                                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                    </textField>
+                                    <button tag="1" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Vu3-og-LXM">
+                                        <rect key="frame" x="0.0" y="10" width="24" height="24"/>
+                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImageNameSelfSignTureSel" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="WER-Dy-ZIG">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="system"/>
+                                        </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="8PL-Ok-t6F"/>
+                                            <constraint firstAttribute="width" constant="24" id="WGI-Tg-ruR"/>
+                                        </constraints>
+                                        <connections>
+                                            <action selector="buttonClicked_TypeAwitch:" target="-2" id="HGd-7Z-Bia"/>
+                                        </connections>
+                                    </button>
+                                    <button tag="2" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6Qo-qg-occ">
+                                        <rect key="frame" x="79" y="10" width="24" height="24"/>
+                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImageNameSelfSignFalseSel" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="HIX-nE-7Hs">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="system"/>
+                                        </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="Fj4-Z7-WUb"/>
+                                            <constraint firstAttribute="width" constant="24" id="pld-bg-xMN"/>
+                                        </constraints>
+                                        <connections>
+                                            <action selector="buttonClicked_TypeAwitch:" target="-2" id="fZS-lU-QMm"/>
+                                        </connections>
+                                    </button>
+                                    <button tag="3" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ahQ-Ib-yZf">
+                                        <rect key="frame" x="159" y="10" width="24" height="24"/>
+                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImageNameSelfSignCircleSel" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="3vg-kd-vrj">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="system"/>
+                                        </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="24" id="2Z2-mE-AY2"/>
+                                            <constraint firstAttribute="height" constant="24" id="VpE-4i-eec"/>
+                                        </constraints>
+                                        <connections>
+                                            <action selector="buttonClicked_TypeAwitch:" target="-2" id="Gqq-Oe-7xe"/>
+                                        </connections>
+                                    </button>
+                                    <button tag="4" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ycV-tn-Tcv">
+                                        <rect key="frame" x="238" y="10" width="24" height="24"/>
+                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImageNameSelfSignLineSel" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="Ria-d2-rGd">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="system"/>
+                                        </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="FHV-qE-fPl"/>
+                                            <constraint firstAttribute="width" constant="24" id="iR6-nC-eKq"/>
+                                        </constraints>
+                                        <connections>
+                                            <action selector="buttonClicked_TypeAwitch:" target="-2" id="aXJ-lL-sXT"/>
+                                        </connections>
+                                    </button>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="W3Q-qa-6mT">
+                                        <rect key="frame" x="22" y="14" width="59" height="16"/>
+                                        <textFieldCell key="cell" lineBreakMode="clipping" id="9zY-yT-Af7">
+                                            <font key="font" metaFont="system"/>
+                                            <color key="textColor" red="1" green="0.14913141730000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                            <color key="backgroundColor" red="1" green="0.14913141730000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                        </textFieldCell>
+                                    </textField>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7bT-QX-6cR">
+                                        <rect key="frame" x="101" y="14" width="60" height="16"/>
+                                        <textFieldCell key="cell" lineBreakMode="clipping" id="qbN-2I-IOK">
+                                            <font key="font" metaFont="system"/>
+                                            <color key="textColor" red="1" green="0.14913141730000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                            <color key="backgroundColor" red="1" green="0.14913141730000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                        </textFieldCell>
+                                    </textField>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="uEm-0u-Vyt">
+                                        <rect key="frame" x="181" y="14" width="59" height="16"/>
+                                        <textFieldCell key="cell" lineBreakMode="clipping" id="bvI-At-WTQ">
+                                            <font key="font" metaFont="system"/>
+                                            <color key="textColor" red="1" green="0.14913141730000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                            <color key="backgroundColor" red="1" green="0.14913141730000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                        </textFieldCell>
+                                    </textField>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="WU9-Gq-sxn">
+                                        <rect key="frame" x="260" y="14" width="59" height="16"/>
+                                        <textFieldCell key="cell" lineBreakMode="clipping" id="68J-dx-r1G">
+                                            <font key="font" metaFont="system"/>
+                                            <color key="textColor" red="1" green="0.14913141730000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                            <color key="backgroundColor" red="1" green="0.14913141730000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                        </textFieldCell>
+                                    </textField>
+                                    <button tag="5" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lMG-VK-Xj4">
+                                        <rect key="frame" x="317" y="10" width="24" height="24"/>
+                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImageNameSelfSignDotSel" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="Cpx-L4-2Y1">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="system"/>
+                                        </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="24" id="1qG-lQ-Pho"/>
+                                            <constraint firstAttribute="height" constant="24" id="Leb-Mp-ut4"/>
+                                        </constraints>
+                                        <connections>
+                                            <action selector="buttonClicked_TypeAwitch:" target="-2" id="4HA-pb-UZ9"/>
+                                        </connections>
+                                    </button>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstAttribute="trailing" secondItem="lMG-VK-Xj4" secondAttribute="trailing" id="3nu-LK-EKN"/>
+                                    <constraint firstItem="lMG-VK-Xj4" firstAttribute="leading" secondItem="WU9-Gq-sxn" secondAttribute="trailing" id="5sv-U4-Jwc"/>
+                                    <constraint firstItem="7bT-QX-6cR" firstAttribute="leading" secondItem="6Qo-qg-occ" secondAttribute="trailing" id="9wD-kt-vYw"/>
+                                    <constraint firstItem="6Qo-qg-occ" firstAttribute="centerY" secondItem="Vu3-og-LXM" secondAttribute="centerY" id="Ae7-lp-xok"/>
+                                    <constraint firstItem="uEm-0u-Vyt" firstAttribute="centerY" secondItem="Vu3-og-LXM" secondAttribute="centerY" id="BbC-bT-3HW"/>
+                                    <constraint firstItem="WU9-Gq-sxn" firstAttribute="centerY" secondItem="Vu3-og-LXM" secondAttribute="centerY" id="BeM-Gl-r5L"/>
+                                    <constraint firstItem="ahQ-Ib-yZf" firstAttribute="leading" secondItem="7bT-QX-6cR" secondAttribute="trailing" id="EPa-fd-4QW"/>
+                                    <constraint firstItem="uEm-0u-Vyt" firstAttribute="leading" secondItem="ahQ-Ib-yZf" secondAttribute="trailing" id="ITx-9L-CzP"/>
+                                    <constraint firstItem="uEm-0u-Vyt" firstAttribute="width" secondItem="W3Q-qa-6mT" secondAttribute="width" id="NVB-z6-1C7"/>
+                                    <constraint firstItem="7bT-QX-6cR" firstAttribute="width" secondItem="W3Q-qa-6mT" secondAttribute="width" id="SLA-8A-D30"/>
+                                    <constraint firstItem="W3Q-qa-6mT" firstAttribute="centerY" secondItem="Vu3-og-LXM" secondAttribute="centerY" id="W3X-Xa-nR5"/>
+                                    <constraint firstItem="ycV-tn-Tcv" firstAttribute="centerY" secondItem="Vu3-og-LXM" secondAttribute="centerY" id="bta-Pk-ltc"/>
+                                    <constraint firstItem="ahQ-Ib-yZf" firstAttribute="centerY" secondItem="Vu3-og-LXM" secondAttribute="centerY" id="c2Z-qf-9AU"/>
+                                    <constraint firstItem="x0t-6o-bFa" firstAttribute="leading" secondItem="WyR-kR-Qty" secondAttribute="leading" id="cvp-ZG-njV"/>
+                                    <constraint firstItem="WU9-Gq-sxn" firstAttribute="width" secondItem="W3Q-qa-6mT" secondAttribute="width" id="d2Y-tu-ta1"/>
+                                    <constraint firstItem="ycV-tn-Tcv" firstAttribute="leading" secondItem="uEm-0u-Vyt" secondAttribute="trailing" id="eaL-ZT-5dh"/>
+                                    <constraint firstItem="lMG-VK-Xj4" firstAttribute="centerY" secondItem="Vu3-og-LXM" secondAttribute="centerY" id="f1N-IG-tWn"/>
+                                    <constraint firstItem="x0t-6o-bFa" firstAttribute="top" secondItem="WyR-kR-Qty" secondAttribute="top" constant="10" id="g1D-GX-HQK"/>
+                                    <constraint firstItem="WU9-Gq-sxn" firstAttribute="leading" secondItem="ycV-tn-Tcv" secondAttribute="trailing" id="gaK-m9-Qot"/>
+                                    <constraint firstItem="6Qo-qg-occ" firstAttribute="leading" secondItem="W3Q-qa-6mT" secondAttribute="trailing" id="hmt-KA-JUS"/>
+                                    <constraint firstItem="W3Q-qa-6mT" firstAttribute="leading" secondItem="Vu3-og-LXM" secondAttribute="trailing" id="lfb-2y-GHw"/>
+                                    <constraint firstItem="Vu3-og-LXM" firstAttribute="top" secondItem="x0t-6o-bFa" secondAttribute="bottom" constant="10" id="phL-BA-jqH"/>
+                                    <constraint firstAttribute="bottom" secondItem="Vu3-og-LXM" secondAttribute="bottom" constant="10" id="v2k-4k-1Dr"/>
+                                    <constraint firstItem="Vu3-og-LXM" firstAttribute="leading" secondItem="WyR-kR-Qty" secondAttribute="leading" id="wFs-iu-gxV"/>
+                                    <constraint firstItem="7bT-QX-6cR" firstAttribute="centerY" secondItem="Vu3-og-LXM" secondAttribute="centerY" id="y6N-vt-L8R"/>
+                                </constraints>
+                            </customView>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="WyR-kR-Qty" firstAttribute="leading" secondItem="vQ9-Zz-gOM" secondAttribute="leading" id="2h0-mU-sVF"/>
+                            <constraint firstItem="WyR-kR-Qty" firstAttribute="trailing" secondItem="vQ9-Zz-gOM" secondAttribute="trailing" id="7yX-vp-R8S"/>
+                            <constraint firstAttribute="bottom" secondItem="WyR-kR-Qty" secondAttribute="bottom" constant="10" id="9Nv-it-8mJ"/>
+                            <constraint firstAttribute="trailing" secondItem="3UA-TF-eaK" secondAttribute="trailing" constant="16" id="E3Q-2K-5jC"/>
+                            <constraint firstItem="4d3-Eg-lwC" firstAttribute="top" secondItem="vQ9-Zz-gOM" secondAttribute="bottom" constant="6" id="HSf-2b-MO3"/>
+                            <constraint firstAttribute="trailing" secondItem="vQ9-Zz-gOM" secondAttribute="trailing" constant="16" id="WdG-2i-VFD"/>
+                            <constraint firstItem="IL8-Yg-kZ6" firstAttribute="leading" secondItem="AnR-E3-pQh" secondAttribute="leading" constant="16" id="b3e-Ix-2ss"/>
+                            <constraint firstItem="3UA-TF-eaK" firstAttribute="leading" secondItem="AnR-E3-pQh" secondAttribute="leading" constant="16" id="hRT-L2-lN2"/>
+                            <constraint firstItem="WyR-kR-Qty" firstAttribute="top" secondItem="4d3-Eg-lwC" secondAttribute="bottom" constant="6" id="krr-dd-upK"/>
+                            <constraint firstAttribute="trailing" secondItem="IL8-Yg-kZ6" secondAttribute="trailing" constant="16" id="n62-7a-ZLA"/>
+                            <constraint firstItem="3UA-TF-eaK" firstAttribute="top" secondItem="AnR-E3-pQh" secondAttribute="top" id="qh1-GL-T8f"/>
+                            <constraint firstItem="4d3-Eg-lwC" firstAttribute="trailing" secondItem="3UA-TF-eaK" secondAttribute="trailing" id="sPR-mW-6vl"/>
+                            <constraint firstItem="4d3-Eg-lwC" firstAttribute="leading" secondItem="3UA-TF-eaK" secondAttribute="leading" id="vmn-MU-x2A"/>
+                            <constraint firstItem="IL8-Yg-kZ6" firstAttribute="top" secondItem="3UA-TF-eaK" secondAttribute="bottom" constant="10" id="x54-JR-esj"/>
+                            <constraint firstItem="vQ9-Zz-gOM" firstAttribute="top" secondItem="IL8-Yg-kZ6" secondAttribute="bottom" constant="10" id="zCs-Zi-Dpy"/>
+                            <constraint firstItem="vQ9-Zz-gOM" firstAttribute="leading" secondItem="AnR-E3-pQh" secondAttribute="leading" constant="16" id="zuD-5v-3DX"/>
+                        </constraints>
+                    </view>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="AnR-E3-pQh" firstAttribute="top" secondItem="c5i-W5-32o" secondAttribute="top" id="1aH-ez-E8X"/>
+                    <constraint firstItem="AnR-E3-pQh" firstAttribute="leading" secondItem="c5i-W5-32o" secondAttribute="leading" id="J4H-bq-dOF"/>
+                    <constraint firstAttribute="trailing" secondItem="AnR-E3-pQh" secondAttribute="trailing" id="cfd-O4-dTy"/>
+                </constraints>
+            </clipView>
+            <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="M60-AB-dee">
+                <rect key="frame" x="-100" y="-100" width="303" height="15"/>
+                <autoresizingMask key="autoresizingMask"/>
+            </scroller>
+            <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="NWD-7b-s4y">
+                <rect key="frame" x="358" y="0.0" width="15" height="508"/>
+                <autoresizingMask key="autoresizingMask"/>
+            </scroller>
+            <point key="canvasLocation" x="-303.5" y="164"/>
+        </scrollView>
+    </objects>
+    <resources>
+        <image name="KMImageNameSelfSignCircleSel" width="24" height="24"/>
+        <image name="KMImageNameSelfSignDotSel" width="24" height="24"/>
+        <image name="KMImageNameSelfSignFalseSel" width="24" height="24"/>
+        <image name="KMImageNameSelfSignLineSel" width="24" height="24"/>
+        <image name="KMImageNameSelfSignTureSel" width="24" height="24"/>
+    </resources>
+</document>