Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove java interface convention #2795

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 58 additions & 102 deletions Charts.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Source/Charts/Charts/BarChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ open class BarChartView: BarLineChartViewBase, BarChartDataProvider
{
guard let
data = _data as? BarChartData,
let set = data.getDataSetForEntry(e) as? IBarChartDataSet
let set = data.getDataSetForEntry(e) as? BarChartDataSet
else { return CGRect.null }

let y = e.y
Expand Down
6 changes: 3 additions & 3 deletions Source/Charts/Charts/BarLineChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD
fileprivate var _isDragging = false
fileprivate var _isScaling = false
fileprivate var _gestureScaleAxis = GestureScaleAxis.both
fileprivate var _closestDataSetToTouch: IChartDataSet!
fileprivate var _closestDataSetToTouch: ChartDataSet!
fileprivate var _panGestureReachedEdge: Bool = false
fileprivate weak var _outerScrollView: NSUIScrollView?

Expand Down Expand Up @@ -1699,12 +1699,12 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD
}

/// - returns: The DataSet object displayed at the touched position of the chart
@objc open func getDataSetByTouchPoint(point pt: CGPoint) -> IBarLineScatterCandleBubbleChartDataSet!
@objc open func getDataSetByTouchPoint(point pt: CGPoint) -> BarLineScatterCandleBubbleChartDataSet!
{
let h = getHighlightByTouchPoint(pt)
if h !== nil
{
return _data?.getDataSetByIndex(h!.dataSetIndex) as! IBarLineScatterCandleBubbleChartDataSet!
return _data?.getDataSetByIndex(h!.dataSetIndex) as! BarLineScatterCandleBubbleChartDataSet!
}
return nil
}
Expand Down
18 changes: 9 additions & 9 deletions Source/Charts/Charts/ChartViewBase.swift
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate
/// object responsible for rendering the data
@objc open var renderer: DataRenderer?

@objc open var highlighter: IHighlighter?
@objc open var highlighter: Highlighter?

/// object that manages the bounds and drawing constraints of the chart
@objc internal var _viewPortHandler: ViewPortHandler!

Expand All @@ -155,7 +155,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate

/// flag that indicates if offsets calculation has already been done or not
fileprivate var _offsetsCalculated = false
/// array of Highlight objects that reference the highlighted slices in the chart
@objc internal var _indicesToHighlight = [Highlight]()

Expand All @@ -168,8 +168,8 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate
@objc open var isDrawMarkersEnabled: Bool { return drawMarkers }

/// The marker that is displayed when a value is clicked on the chart
@objc open var marker: IMarker?
@objc open var marker: Marker?

fileprivate var _interceptTouchEvents = false

/// An extra offset to be appended to the viewport's top
Expand Down Expand Up @@ -276,8 +276,8 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate
_data = nil
_offsetsCalculated = false
_indicesToHighlight.removeAll()
lastHighlighted = nil
lastHighlighted = nil
setNeedsDisplay()
}

Expand Down Expand Up @@ -871,7 +871,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate
/// - returns: `true` if the image was saved successfully
open func save(to path: String, format: ImageFormat, compressionQuality: Double) -> Bool
{
guard let image = getChartImage(transparent: format != .jpeg)
guard let image = getChartImage(transparent: format != .jpeg)
else { return false }

var imageData: Data!
Expand All @@ -895,7 +895,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate
return false
}

return true
return true
}

@objc internal var _viewportJobs = [ViewPortJob]()
Expand Down
6 changes: 3 additions & 3 deletions Source/Charts/Charts/CombinedChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import CoreGraphics
open class CombinedChartView: BarLineChartViewBase, CombinedChartDataProvider
{
/// the fill-formatter used for determining the position of the fill-line
@objc internal var _fillFormatter: IFillFormatter!
@objc internal var _fillFormatter: FillFormatter!

/// enum that allows to specify the order in which the different data objects for the combined-chart are drawn
@objc(CombinedChartDrawOrder)
public enum DrawOrder: Int
Expand Down Expand Up @@ -60,7 +60,7 @@ open class CombinedChartView: BarLineChartViewBase, CombinedChartDataProvider
}
}

@objc open var fillFormatter: IFillFormatter
@objc open var fillFormatter: FillFormatter
{
get
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Charts/Charts/HorizontalBarChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ open class HorizontalBarChartView: BarChartView
{
guard
let data = _data as? BarChartData,
let set = data.getDataSetForEntry(e) as? IBarChartDataSet
let set = data.getDataSetForEntry(e) as? BarChartDataSet
else { return CGRect.null }

let y = e.y
Expand Down
4 changes: 2 additions & 2 deletions Source/Charts/Components/AxisBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ open class AxisBase: ComponentBase
}

/// Custom formatter that is used instead of the auto-formatter if set
fileprivate var _axisValueFormatter: IAxisValueFormatter?
fileprivate var _axisValueFormatter: AxisValueFormatter?

@objc open var labelFont = NSUIFont.systemFont(ofSize: 10.0)
@objc open var labelTextColor = NSUIColor.black
Expand Down Expand Up @@ -157,7 +157,7 @@ open class AxisBase: ComponentBase
/// Sets the formatter to be used for formatting the axis labels.
/// If no formatter is set, the chart will automatically determine a reasonable formatting (concerning decimals) for all the values that are drawn inside the chart.
/// Use `nil` to use the formatter calculated by the chart.
@objc open var valueFormatter: IAxisValueFormatter?
@objc open var valueFormatter: AxisValueFormatter?
{
get
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import Foundation
import CoreGraphics

@objc(IChartMarker)
public protocol IMarker: class
@objc(ChartMarker)
public protocol Marker: NSObjectProtocol
{
/// - returns: The desired (general) offset you wish the IMarker to have on the x-axis.
///
Expand All @@ -29,12 +29,12 @@ public protocol IMarker: class
/// - parameter point: This is the point at which the marker wants to be drawn. You can adjust the offset conditionally based on this argument.
func offsetForDrawing(atPoint: CGPoint) -> CGPoint

/// This method enables a custom IMarker to update it's content every time the IMarker is redrawn according to the data entry it points to.
/// This method enables a custom Marker to update it's content every time the Marker is redrawn according to the data entry it points to.
///
/// - parameter entry: The Entry the IMarker belongs to. This can also be any subclass of Entry, like BarEntry or CandleEntry, simply cast it at runtime.
/// - parameter entry: The Entry the Marker belongs to. This can also be any subclass of Entry, like BarEntry or CandleEntry, simply cast it at runtime.
/// - parameter highlight: The highlight object contains information about the highlighted value such as it's dataset-index, the selected range or stack-index (only stacked bar entries).
func refreshContent(entry: ChartDataEntry, highlight: Highlight)

/// Draws the IMarker on the given position on the given context
/// Draws the Marker on the given position on the given context
func draw(context: CGContext, point: CGPoint)
}
2 changes: 1 addition & 1 deletion Source/Charts/Components/MarkerImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import CoreGraphics
#endif

@objc(ChartMarkerImage)
open class MarkerImage: NSObject, IMarker
open class MarkerImage: NSObject, Marker
{
/// The marker image to render
@objc open var image: NSUIImage?
Expand Down
2 changes: 1 addition & 1 deletion Source/Charts/Components/MarkerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import CoreGraphics
#endif

@objc(ChartMarkerView)
open class MarkerView: NSUIView, IMarker
open class MarkerView: NSUIView, Marker
{
open var offset: CGPoint = CGPoint()

Expand Down
2 changes: 1 addition & 1 deletion Source/Charts/Data/Implementations/ChartBaseDataSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Foundation
import CoreGraphics


open class ChartBaseDataSet: NSObject, IChartDataSet
open class ChartBaseDataSet: NSObject
{
public required override init()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ open class BarChartData: BarLineScatterCandleBubbleChartData
super.init()
}

public override init(dataSets: [IChartDataSet]?)
public override init(dataSets: [ChartDataSet]?)
{
super.init(dataSets: dataSets)
}
Expand Down Expand Up @@ -61,7 +61,7 @@ open class BarChartData: BarLineScatterCandleBubbleChartData
let start = fromX
fromX += groupSpaceWidthHalf

for set in _dataSets as! [IBarChartDataSet]
for set in _dataSets as! [BarChartDataSet]
{
fromX += barSpaceHalf
fromX += barWidthHalf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Foundation
import CoreGraphics


open class BarChartDataSet: BarLineScatterCandleBubbleChartDataSet, IBarChartDataSet
open class BarChartDataSet: BarLineScatterCandleBubbleChartDataSet
{
fileprivate func initialize()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ open class BarLineScatterCandleBubbleChartData: ChartData
super.init()
}

public override init(dataSets: [IChartDataSet]?)
public override init(dataSets: [ChartDataSet]?)
{
super.init(dataSets: dataSets)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Foundation
import CoreGraphics


open class BarLineScatterCandleBubbleChartDataSet: ChartDataSet, IBarLineScatterCandleBubbleChartDataSet
open class BarLineScatterCandleBubbleChartDataSet: ChartDataSet
{
// MARK: - Data functions and accessors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ open class BubbleChartData: BarLineScatterCandleBubbleChartData
super.init()
}

public override init(dataSets: [IChartDataSet]?)
public override init(dataSets: [ChartDataSet]?)
{
super.init(dataSets: dataSets)
}

/// Sets the width of the circle that surrounds the bubble when highlighted for all DataSet objects this data object contains
@objc open func setHighlightCircleWidth(_ width: CGFloat)
{
for set in (_dataSets as? [IBubbleChartDataSet])!
for set in (_dataSets as? [BubbleChartDataSet])!
{
set.highlightCircleWidth = width
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Foundation
import CoreGraphics


open class BubbleChartDataSet: BarLineScatterCandleBubbleChartDataSet, IBubbleChartDataSet
open class BubbleChartDataSet: BarLineScatterCandleBubbleChartDataSet
{
// MARK: - Data functions and accessors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ open class CandleChartData: BarLineScatterCandleBubbleChartData
super.init()
}

public override init(dataSets: [IChartDataSet]?)
public override init(dataSets: [ChartDataSet]?)
{
super.init(dataSets: dataSets)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Foundation
import CoreGraphics


open class CandleChartDataSet: LineScatterCandleRadarChartDataSet, ICandleChartDataSet
open class CandleChartDataSet: LineScatterCandleRadarChartDataSet
{

public required init()
Expand Down
Loading